You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As well as this, we're also pretty dumb about how we wrap code before transpiling it. Sometimes we need to wrap in parens, sometimes we need to wrap in an anonymous function (because we're taking a small piece of code from the file and transpiling that in a way that might otherwise not make sense in the context).
We're doing multiple Babel transpiles:
See: https://github.com/concrete-utopia/utopia/blob/master/editor/src/core/workers/parser-printer/parser-printer-parsing.ts#L1740-L1757
And: https://github.com/concrete-utopia/utopia/blob/master/editor/src/core/workers/parser-printer/parser-printer-parsing.ts#L3951-L3970
So both of the above could certainly be squashed into a single step (I'm not sure if there really was a reason to do the two separately other than maybe it was easier at the time?). That would halve the babel transpiles and halve the amount of times we update source maps.
As well as this, we're also pretty dumb about how we wrap code before transpiling it. Sometimes we need to wrap in parens, sometimes we need to wrap in an anonymous function (because we're taking a small piece of code from the file and transpiling that in a way that might otherwise not make sense in the context).
See: https://github.com/concrete-utopia/utopia/blob/master/editor/src/core/workers/parser-printer/parser-printer-transpiling.ts#L637
Because we don't know which type of wrapping we need to use, we'll try one first and fall back to the other. So if we could know upfront, then we could save ourselves some extra transpiling there too.
The text was updated successfully, but these errors were encountered: