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

Transpile ES6 code through Babel in Webpack 4 #2155

Merged
merged 4 commits into from
Jul 5, 2018
Merged

Conversation

jesusbotella
Copy link
Contributor

@jesusbotella jesusbotella commented Jun 27, 2018

This PR enables us to write ES6 code in Carto.js, by later transpiling it when making the production bundle.

And I did the update to Webpack 4 as well because I saw it easy 🤷‍♂️

⚠️ WARNING ⚠️

This PR has to be merged in conjunction with CartoDB/cartodb#14117

@jesusbotella jesusbotella changed the title Transpile ES6 code through Babel in Webpack Transpile ES6 code through Babel in Webpack 4 Jun 27, 2018
@@ -25,7 +25,8 @@
"Ruben Moya <[email protected]>",
"Jesus Arroyo Torrens <[email protected]>",
"Iago Lastra <[email protected]>",
"Elena Torró <[email protected]>"
"Elena Torró <[email protected]>",
"Jesús Botella <[email protected]>"
Copy link
Contributor

Choose a reason for hiding this comment

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

😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ssshh...nobody's gonna notice 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

😂

Copy link
Contributor

Choose a reason for hiding this comment

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

🕵️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey! What's going on here? 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

but what happened 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tenor

Copy link
Contributor

@rjimenezda rjimenezda left a comment

Choose a reason for hiding this comment

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

Looks good. On to acceptance.

We should check that building the public one works fine. Also comparing bundle sizes might be interesting in this case, regarding ES6 & so on

"babel-preset-es2015": "~6.24.1",
"babelify": "~7.3.0",
"babelify": "^7.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@jesusbotella
Copy link
Contributor Author

jesusbotella commented Jul 3, 2018

I think I did a bundle size comparison and there wasn't a big difference in terms of size :(

What can be interesting is to reduce the final bundle, because it is now ~300kb minified.

@rjimenezda
Copy link
Contributor

That's fine, we're adding support for ES6 so I was worried we might have some extra boilerplate.

300kb is huge though 🤔

@jesusbotella
Copy link
Contributor Author

Yes, I passed the Webpack Bundle Analyzer, and it was mostly jQuery, Backbone, and Underscore.

@rubenmoya rubenmoya merged commit 89aeeda into master Jul 5, 2018
@rubenmoya rubenmoya deleted the update-webpack4 branch July 11, 2018 13:41
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