Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

chore(babel): migration to Babel 7 [PART-1] #1888

Merged
merged 8 commits into from Jan 16, 2019
Merged

Conversation

samouss
Copy link
Collaborator

@samouss samouss commented Jan 10, 2019

Summary

This PR moves packages, Storybook, docgen to Babel 7. Only the examples are still built with Babel 6 but they are outside of the workspaces. We can update them later. The major change is that we now use the project-wide configuration babel.config.js rather than scoped .babelrc. We only have one point of contact for the all projects. We can write overrides per files / folders to apply a specific set of plugins to the matches (like we do for maps package).

The downside of this approach is that since we called babel from a nested level we have to provide a flag to tell Babel to find the proper configuration. Previously it was automatic, but not anymore. There is mode to call upward to walks and find the correct configuration. Note that we are gonna hoist all the build step at the top of the package so this mode won't be used anymore at some point (at least for the packages).

Last downside of this change is the bundle size, since Babel 7 is closer to the spec it generates more helpers to actually check if the code is valid or not. There is a loose mode to avoid this but we can get rid of this increase with @babel/runtime. It's implemented in the next PR.

@samouss samouss requested a review from a team January 10, 2019 11:25
@samouss samouss changed the title chore: migration to Babel 7 [PART-1] chore(babel): migration to Babel 7 [PART-1] Jan 10, 2019
@algobot
Copy link
Contributor

algobot commented Jan 10, 2019

Deploy preview for react-instantsearch ready!

Built with commit cb7330f

https://deploy-preview-1888--react-instantsearch.netlify.com

@algolia algolia deleted a comment from algobot Jan 10, 2019
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

this seems fine overall, but there's conflicts, so I will wait until resolved to review properly

@samouss samouss merged commit e10297c into master Jan 16, 2019
@samouss samouss deleted the chore/babel7-p1-migration branch January 16, 2019 09:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants