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

Build: Make babel tranpile smarter by using chrome version (fixes #6367) #6575

Merged
merged 1 commit into from
Jan 8, 2017
Merged

Build: Make babel tranpile smarter by using chrome version (fixes #6367) #6575

merged 1 commit into from
Jan 8, 2017

Conversation

gyandeeps
Copy link
Contributor

@gyandeeps gyandeeps commented Jan 8, 2017

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Test Plan: N/A

Before

    aboutPages.entry.js    2.62 MB       0  [emitted]  aboutPages
           app.entry.js    2.32 MB       1  [emitted]  app

After

    aboutPages.entry.js    2.52 MB       0  [emitted]  aboutPages
           app.entry.js    2.16 MB       1  [emitted]  app

@bbondy
Copy link
Member

bbondy commented Jan 8, 2017

Thanks!

@bbondy bbondy merged commit 5b6c83c into brave:master Jan 8, 2017
@luixxiul luixxiul added this to the 0.13.0 milestone Jan 8, 2017
@gyandeeps gyandeeps deleted the issue6367 branch January 8, 2017 16:04
@bsclifton
Copy link
Member

@gyandeeps great find! 😄

@hzoo
Copy link
Contributor

hzoo commented Feb 15, 2017

Awesome to see this! Wanted to leave some comments (as a Babel maintainer):

Instead of chrome 54 (since brave is on 56 now), you can do something like

"targets": {
  "browsers": ["last 2 Chrome versions"]
}

Although now that I think about it, we should add one for brave 😝? A package was made for electron babel/babel-preset-env#144

I'd recommend using the useBuiltIns option to reduce the number of polyfills loaded as well. https://github.com/babel/babel-preset-env#usebuiltins if you use babel-polyfill (although not sure if that is loaded or not in the source?

@bbondy
Copy link
Member

bbondy commented Feb 16, 2017

thanks for the tips @hzoo
@gyandeeps would you mind trying to use useBuiltIns and always use latest for target

@hzoo
Copy link
Contributor

hzoo commented Feb 16, 2017

Might need some help with determining where the polyfill is loaded in (if it is at all?)

The way it works currently is that it literally tries to find import "babel-polyfill"; in your code (or require) and then replace that code with the individual imports so it needs to be imported in the entry point file rather than in a script tag or the webpack entry point etc

@gyandeeps
Copy link
Contributor Author

Thanks @hzoo for feedback.

  • I dont think babel-polyfill is used in source code.
  • Since we know what version of chrome we use then i guess i can update it to 56.

So just change the chrome version. Any thing i am missing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants