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
Split exportExtensions into exportDefault and exportNamespace plugins… #6920
Conversation
@@ -0,0 +1,35 @@ | |||
# @babel/plugin-syntax-export-default | |||
|
|||
> Allow parsing of export default from. |
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.
Nit: export default from should be in backticks so that it is formatted as code? (export default from
)
@@ -0,0 +1,35 @@ | |||
# @babel/plugin-syntax-export-namespace | |||
|
|||
> Allow parsing of export namespace from. |
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.
Also here
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/6037/ |
@@ -158,6 +159,8 @@ registerPlugins({ | |||
"proposal-class-properties": require("@babel/plugin-proposal-class-properties"), | |||
"proposal-decorators": require("@babel/plugin-proposal-decorators"), | |||
"proposal-do-expressions": require("@babel/plugin-proposal-do-expressions"), | |||
"proposal-export-default": require("@babel/plugin-proposal-export-default"), |
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.
@Daniel15 I noticed standalone
was including syntax-export-extensions
, but not the actual transforms. Any reason not to?
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.
well one thing is that the repl uses stage-x but none of the plugins themselves since not sure who is using it that way
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.
@existentialism Yeah this is fine. It might have just been an oversight. I have an item on my todo list to add a script that verifies that every syntax + transform plugin in the monorepo is listed here too. Maybe I'll file a task for that and let someone else do the work 😛
+1 for |
i'm cool with the longer name |
@@ -1 +1 @@ | |||
{ "plugins": ["exportExtensions"] } |
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.
later: we could probably rename these test files
3cf8dee
to
964bcc2
Compare
@hzoo @nicolo-ribaudo could use a quick re-review, added -from to transforms and plugins |
@@ -0,0 +1,35 @@ | |||
# @babel/plugin-syntax-export-namespace-from | |||
|
|||
> Allow parsing of `export namespace from`. |
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.
export * as namespace from
@@ -107,7 +107,7 @@ const options = { | |||
const flowOptionsMapping = { | |||
esproposal_class_instance_fields: "classProperties", | |||
esproposal_class_static_fields: "classProperties", | |||
esproposal_export_star_as: "exportExtensions", | |||
esproposal_export_star_as: "exportNamespace", |
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.
exportNamespaceFrom
I think we should consider adding an alias to babel/packages/babylon/src/index.js Line 63 in 9d9710c
exportExtensions is given, and auto-expand it to the two separate flags, to help things migrate.
|
Yeah that's a good idea, should be fine in another PR |
… in babylon
Trying to clean up some v7 TODOs.
Was chatting with @hzoo but we could rename the plugins (and resulting transforms) to
export-default-from
andexport-namespace-from
to get a slightly more clear error:But probably not a huge deal?
Also, I removed some redundant tests in Babylon.