-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
put babel and browserslist to better use #631
base: dev
Are you sure you want to change the base?
Conversation
babel |
What's the status of this? |
I'll fix the conflicts when I next look at it again. |
adds a legacy build which uses babel to keep support for older browsers. This will be output to the The modern file still uses babel to transpile the code base to help solve any cross browser discrepancies. At the moment |
I think the legacy build needs to be the default for the minified versions. Perhaps the new bundled library should be For the node version I'm not sure. We have to pick one. Since node_modules are not run through babel, I think it needs to point to the legacy build. And probably have a second entry point for the modern version. I'm ready to add typescript now. A big thing that needs to work is the source map - so dev tools works. |
I'm thinking it's maybe overkill providing two versions. The difference between |
I agree - the extra build isn't worth it for that. Plus I bet that removing the shims that I put in over the years would be more than 4K. And it should be easy to add typescript to the build right now - might as well do that so there is only one round of testing. |
a79e649
to
bffcf47
Compare
I've set up typescript in this now. Everything seems to still be working fine. So now babel will transpile all |
I'm revisiting this and doing some testing. It's not good that the package size jumps 80K for the polyfills when I know from browser testing they aren't necessary. And if the user has some other js loaded they might already have the polyfills. I'm doing some experiments... |
maybe more of a proof of concept at the moment but i'm unsure as to whether the builds can be reduced in size any more.
Ive added corejs and setup babel/preset-env to actually be used to polyfill for unsupported browsers. I've used
defaults, not ie 11
so you can see how easy it is to modify which browsers are supported or not. currentlydefaults
supports ie 11. So removing the, not ie 11
will compile with support for for ie 11.I've left the
debug
flag in so you can see where babel is adding its polyfills. when using, not ie 11
there are far fewer polyfills being added which makes it a little easier to follow whats being added where instead of being cluttered by the ie 11 polyfills.currently from what i can see the build sizes would go like this:
* just to prove babel will use no polyfills on a browser which supports everything.