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

Update new project template to metro-react-native-babel-preset #20327

Closed
janicduplessis opened this issue Jul 21, 2018 · 7 comments
Closed

Update new project template to metro-react-native-babel-preset #20327

janicduplessis opened this issue Jul 21, 2018 · 7 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.

Comments

@janicduplessis
Copy link
Contributor

janicduplessis commented Jul 21, 2018

The babel plugin was recently moved to the metro repo and published under metro-react-native-babel-preset. We need to make sure to update all references to the old babel plugin as it will no longer be updated. I think the main thing that needs updating is the new project template .babelrc (https://github.com/facebook/react-native/tree/master/local-cli/templates/HelloWorld) and package.json (https://github.com/facebook/react-native/blob/master/local-cli/init/init.js#L102).

Note that it it needs to be set as module:metro-react-native-babel-preset in .babelrc since it does not respect the standard babel preset naming (maybe we could fix that also).

We also need to communicate this properly in the release notes for existing apps.

@janicduplessis janicduplessis added Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. 💻CLI labels Jul 21, 2018
@jamsch
Copy link
Contributor

jamsch commented Jul 21, 2018

So this means that metro-react-native-babel-preset is going to be a drop in replacement for babel-preset-react-native@5.x / Babel 7 RN projects?

@janicduplessis
Copy link
Contributor Author

@jamsch Yes it is exactly the same, it was just moved to the metro repo and published under acnew name.

@kelset
Copy link
Contributor

kelset commented Jul 23, 2018

Yes, I guess this needs to be done before 0.57.0 is released (the first RC will be cut today).

As a side-change to this it would be useful to migrate the .babelrc config to the new babel.config.js since, quoting from the docs:

If Babel finds other .babelrc files while transpiling files in subfolder, it will merge the configuration together.
Note that it can lead to undefined behaviors, and we recommend to use babel.config.js documentation instead.

@grabbou
Copy link
Contributor

grabbou commented Jul 23, 2018

Let's check this issue once we release RC, we can test the full workflow and see where the references to old babel plugin are and how that affects the project itself.

@janicduplessis
Copy link
Contributor Author

@grabbou It should still work with the old plugin as long as there are no significant changes to it. But yeah, we should try to update it before the next release just in case.

@rafaellincoln
Copy link
Contributor

@kelset @grabbou Has not this been done yet?

@kelset
Copy link
Contributor

kelset commented Aug 24, 2018

It has been, via this #20653 (linked above)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants