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 support for namespace imports #1050

Closed
johno opened this issue May 1, 2020 · 7 comments
Closed

Add support for namespace imports #1050

johno opened this issue May 1, 2020 · 7 comments
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem 💎 v2 Issues related to v2
Milestone

Comments

@johno
Copy link
Member

johno commented May 1, 2020

import * as Foo from './bar'
@johno johno added 🦋 type/enhancement This is great to have 🙆 yes/confirmed This is confirmed and ready to be worked on 💎 v2 Issues related to v2 labels May 1, 2020
@johno johno mentioned this issue May 1, 2020
25 tasks
@ankeetmaini
Copy link
Contributor

I can take a stab at it!

@johno
Copy link
Member Author

johno commented May 6, 2020

That'd be great @ankeetmaini ankeetmaini! Let us know if you have any questions!

@apipkin
Copy link

apipkin commented May 19, 2020

I am curious if this is the same issue I'm having when using <Examples.ButtonGroup /> in my mdx files. It tells me it cannot find Examples.

Here's a reproduction of the issue if this helps the effort! https://github.com/apipkin/gastby-issue-1

@ankeetmaini
Copy link
Contributor

@johno I am new to this codebase. Will this change belong in the mdx package or the babel plugin? Will try and get some early feedback by this weekend.

@johno
Copy link
Member Author

johno commented May 19, 2020

Great, it'll be in the babel plugin @ankeetmaini

@apipkin I have a WIP PR that fixes the bug you're referring to here: #953

@apipkin
Copy link

apipkin commented May 19, 2020

@johno Awesome! Thanks!

@johno johno added this to the v2 milestone Jul 22, 2020
wooorm added a commit that referenced this issue Dec 11, 2020
This updates MDX to use and support remark@13, which comes with a new internal
parser (micromark), and supports CommonMark.
See <https://github.com/remarkjs/remark/releases/tag/13.0.0> for more
information.
In short, this means MDX parses markdown closer to what folks expect.
And it means all latest plugins work (again).

But it also means that parsing MDX syntax (JSX, expressions, ESM) got an update.
See: <https://github.com/micromark/micromark-extension-mdxjs> and
<https://github.com/syntax-tree/mdast-util-mdx> for the syntax.
In short, this means MDX parsing is now JavaScript-aware: import/exports are
actually parsed for being valid JavaScript.
Expressions previously counted braces, but now can include braces in strings or
comments or whatnot.
This also means we can drop Babel (in a future PR) because we already have a
JavaScript AST.

This also deprecates the packages `remark-mdxjs` (which is now the default in
`remark-mdx`), `remark-mdx-remove-exports`, and `remark-mdx-remove-imports`.

Related to GH-704.
Related to GH-1041.

Closes GH-720.
Closes GH-1028.
Closes GH-1050.
Closes GH-1081.
Closes GH-1193.
Closes GH-1238.
Closes GH-1283.
Closes GH-1316.
Closes GH-1318.
Closes GH-1341.
wooorm added a commit that referenced this issue Dec 15, 2020
This updates MDX to use and support remark@13, which comes with a new internal
parser (micromark), and supports CommonMark.
See <https://github.com/remarkjs/remark/releases/tag/13.0.0> for more
information.
In short, this means MDX parses markdown closer to what folks expect.
And it means all latest plugins work (again).

But it also means that parsing MDX syntax (JSX, expressions, ESM) got an update.
See: <https://github.com/micromark/micromark-extension-mdxjs> and
<https://github.com/syntax-tree/mdast-util-mdx> for the syntax.
In short, this means MDX parsing is now JavaScript-aware: import/exports are
actually parsed for being valid JavaScript.
Expressions previously counted braces, but now can include braces in strings or
comments or whatnot.
This also means we can drop Babel (in a future PR) because we already have a
JavaScript AST.

This also deprecates the packages `remark-mdxjs` (which is now the default in
`remark-mdx`), `remark-mdx-remove-exports`, and `remark-mdx-remove-imports`.

Related to GH-704.
Related to GH-1041.

Closes GH-720.
Closes GH-1028.
Closes GH-1050.
Closes GH-1081.
Closes GH-1193.
Closes GH-1238.
Closes GH-1283.
Closes GH-1316.
Closes GH-1318.
Closes GH-1341.
Closes GH-1367.

Reviewed-by: Christian Murphy <[email protected]>
@wooorm
Copy link
Member

wooorm commented Dec 18, 2020

Hi all! I’m going to close this as it landed on the main, the (now default) branch we’re using to gear up to the MDX@2 release.

The reason is so that it’s more clear which issues still need to be solved already and don’t require further work.

Expect another next release soonish, which might include it, or maybe it’s already released as a beta!

For more info, see #1041.

@wooorm wooorm closed this as completed Dec 18, 2020
@wooorm wooorm added ⛵️ status/released 🐛 type/bug This is a problem 👶 semver/patch This is a backwards-compatible fix 🗄 area/interface This affects the public interface and removed 🙆 yes/confirmed This is confirmed and ready to be worked on 🦋 type/enhancement This is great to have labels Dec 18, 2020
@wooorm wooorm added the 💪 phase/solved Post is done label Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem 💎 v2 Issues related to v2
Development

Successfully merging a pull request may close this issue.

4 participants