Skip to content
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

Add additional information for plugin-syntax-dynamic-import #2197

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gunn4r
Copy link

@gunn4r gunn4r commented Mar 11, 2020

Adds addition context and information about what the plugin does and when to use it. Information is from @nicolo-ribaudo on slack: https://babeljs.slack.com/archives/C0DFJT81H/p1583965874176800

@netlify
Copy link

netlify bot commented Mar 11, 2020

Deploy preview for babel ready!

Built with commit 445887e

https://deploy-preview-2197--babel.netlify.com

@netlify
Copy link

netlify bot commented Mar 11, 2020

Deploy preview for babel ready!

Built with commit ae63fba

https://deploy-preview-2197--babel.netlify.com

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

docs/plugin-syntax-dynamic-import.md Outdated Show resolved Hide resolved
docs/plugin-syntax-dynamic-import.md Outdated Show resolved Hide resolved
@gunn4r
Copy link
Author

gunn4r commented Mar 12, 2020

@nicolo-ribaudo @existentialism When you guys have a sec, I committed those suggestions. Thanks!

@@ -5,6 +5,14 @@ sidebar_label: syntax-dynamic-import
original_id: babel-plugin-syntax-dynamic-import
---

`babel-plugin-syntax-dynamic-import` is needed to enable support for parsing `import()`

**Usage notes:**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using babel-preset-env, it's automatically handled

I don't think this applies for v6?

Otherwise, you need babel-plugin-proposal-dynamic-import

babel-plugin-proposal-dynamic-import doesn't exist :)

Should we link to https://github.com/airbnb/babel-plugin-dynamic-import-node?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 oops!

Yeah maybe something like:

Otherwise, consider using babel-plugin-dynamic-import-node.

@nicolo-ribaudo Just just verify, can you confirm that babel-preset-env (v6) does not automatically handle this? If not, I'll strike that line.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo Mar 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, it's only supported in Babel 7 (7.5.0)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I'll strike that line.

2. If you are using Webpack or Rollup, you shouldn't transpile `import()` with Babel and let the bundler handle it for you
3. Otherwise, you need `@babel/plugin-proposal-dynamic-import`


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gunn4r Can you rebase on upstream? We have removed versioned_docs so I think only this section is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants