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

Create React App instructions shouldn't recommend "rewired" #358

Closed
gaearon opened this issue Dec 14, 2018 · 3 comments
Closed

Create React App instructions shouldn't recommend "rewired" #358

gaearon opened this issue Dec 14, 2018 · 3 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented Dec 14, 2018

https://mdxjs.com/getting-started/create-react-app#create-react-app

The "rewired" package has never been supported. CRA 2.0 supports Babel Macros and MDX was one of the reasons we added it — would be nice if the guide recommended the official solution. Thanks!

@johno johno added the examples label Dec 14, 2018
johno added a commit that referenced this issue Dec 14, 2018
@johno johno closed this as completed in 9cb7c3a Dec 14, 2018
@jamesknelson
Copy link

jamesknelson commented Dec 15, 2018

Hey there, I made the mdx.macro package, but I'm really not sure that the docs should point to it because it doesn't currently work properly, and won't unless a new feature is added to babel itself. You can see more details on this in these two issues on create-react-app.

The gist is, if a macro reads a separate file, there's currently no way to watch that file for changes. This means that it's possible to load an MDX file with mdx.macro, but you then have to manually restart the server each time that you change it. I've spent a day trying various hacks because I really want this feature myself, but haven't come up with anything that works.

I honestly think that CRA jumped the gun by advertising MDX support via babel-macros. I've spent a lot of time trying to make it work, but for anything production related it's just not ready. Imo, "rewired" with CRA1 or the unsupported loader syntax with CRA2 (i.e. !babel-loader!mdx-loader!) provide a far better dev experience.

@johno
Copy link
Member

johno commented Dec 15, 2018

Thanks for the added details @jamesknelson, I'm going to reopen this until the missing features are added and we get live reload support on imported files.

@johno johno reopened this Dec 15, 2018
johno added a commit that referenced this issue Feb 18, 2019
* Use mdx.macro for create-react-app example

Closes #358

* Update surrounding documentation

* Fix linting

* Nuke esling config in cra so it doesn't get picked up
@johno
Copy link
Member

johno commented Mar 18, 2019

I'm going to go ahead and close this for now since there's not much actionable I can do on MDX's end right now. I've subscribed to the other issues linked so I can keep an eye on them. Right now I don't have the time/bandwidth to attempt a fix in babel core or mdx.macro myself.

@johno johno closed this as completed Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants