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
See these failing tests for examples when hoisting import and export declarations is helpful/necessary. Thanks to @sokra for those tests.
This will require a slightly more sophisticated compilation strategy, since we're no longer just replacing import and export declarations in place, but potentially moving them around. I suspect I will end up using https://www.npmjs.com/package/magic-string, which also provides source maps.
One subtle implication of this change is that imported symbols should not be visible outside the block where they are imported, because we won't be hoisting import declarations outside the block, and the variables are likely to be undefined before the block, so they might as well not be accessible at all outside the block. In other words, this change is definitely a good idea: #17
The text was updated successfully, but these errors were encountered:
See these failing tests for examples when hoisting
import
andexport
declarations is helpful/necessary. Thanks to @sokra for those tests.This will require a slightly more sophisticated compilation strategy, since we're no longer just replacing
import
andexport
declarations in place, but potentially moving them around. I suspect I will end up using https://www.npmjs.com/package/magic-string, which also provides source maps.One subtle implication of this change is that imported symbols should not be visible outside the block where they are imported, because we won't be hoisting
import
declarations outside the block, and the variables are likely to be undefined before the block, so they might as well not be accessible at all outside the block. In other words, this change is definitely a good idea: #17The text was updated successfully, but these errors were encountered: