New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(babel): export * as ns
support
#511
Conversation
BREAKING CHANGES: rollup 1 dependency is bumped to ^1.26.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
packages/babel/src/index.js
Outdated
@@ -45,6 +45,7 @@ const unpackInputPluginOptions = ({ skipPreflightCheck = false, ...rest }) => { | |||
supportsStaticESM: true, | |||
supportsDynamicImport: true, | |||
supportsTopLevelAwait: true, | |||
supportsExportNamespaceFrom: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be possible to make this conditional (from Rollup's perspective) to avoid changing peer dep range and thus avoid this being a breaking change. I bet it should be rather easily possible to read Babel's version somehow as well, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need detect Babel version, undeclared caller flags will be considered as noop for preset-env.
I have updated PR to check rollup versions. however it seems that I can not retrieve version from rollup/package.json
.
packages/babel/src/index.js
Outdated
@@ -1,4 +1,5 @@ | |||
import * as babel from '@babel/core'; | |||
import { VERSION } from "rollup"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure but it probably would be better to grab this from this: https://rollupjs.org/guide/en/#thismeta-rollupversion-string-watchmode-boolean . This would require moving unpackInputPluginOptions
call to one of the hooks (buildStart
?) though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. One more argument is that importing rollup
from a plugin is not guaranteed to give you the correct Rollup version in more complex npm dependency scenarios, especially if Rollup is used programmatically while this.meta.rollupVersion
is guaranteed to be correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shellscape could you recheck commits format?
export * as ns
supportexport * as ns
support
@Andarist yeah I'll fix that on merge |
@JLHwung you have the following in your first commit on this fork:
But the "no" checkbox for Breaking Changes is checked. You also don't have a corresponding update to package.json - is one needed? |
@shellscape the PR had a breaking change in it at first but it has been changed to avoid it after a review |
I wish I could edit the commit history but unfortunately I don't get computers in hands for a few days. Can you rebase interactively? Thank you. |
We're cool now. New version published |
* declares export * as ns support * check rollup version * oof * refactor: get rollupVersion from this.meta in options hook
Rollup Plugin Name:
{babel}
This PR contains:
Are tests included?
I can't add tests yet because Babel 7.11 is not yet published.
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
@babel/preset-env
7.11 will supportexport * as ns
(babel/babel#11849), where a new caller support flagsupportsExportNamespaceFrom
is introduced. This PR declares this flag so Babel can skipexport-namespace-from
transform when it is bundled from Rollup.The Rollup 1 peer dependence is bumped to 1.26.0, in which
export * as ns
was initially supported.