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
[7.0] Remove babel-runtime
from babel-x packages (check if we can)
#5118
Comments
And I think @kaicataldo said he might be interested |
babel-runtime
from babel-x packagesbabel-runtime
from babel-x packages (check if we can)
Yes please. Babel is always the biggest dependency in my projects because deduping never works and I end up with a gadzillion copies of |
Yep I realized this could probably work since we probably only use node 4 supported ones anyway. Might be hairy but just need to figure it out. |
We should make extra sure our tests are running on native Node 4 with no polyfills loaded, otherwise we could run into issues. |
This part has to do with function runExec(opts, execCode, execDirname) {
const sandbox = {
...helpers,
babelHelpers,
assert: chai.assert,
transform: babel.transform,
opts,
exports: {},
require(id) {
return require(id[0] === "." ? path.resolve(execDirname, id) : id);
}
};
const fn = new Function(...Object.keys(sandbox), execCode);
return fn.apply(null, Object.values(sandbox));
} we run tests with |
Does someone works on this already? I think we should mention #5135 in the checklist |
^ Can be in 6.x since its internal so not necessary, not sure if anyone working on it, I just asked @kaicataldo if he wanted to look into I did find we need to remove the |
@hzoo there are some other modules in |
Yeah was just talking to Logan about that yesterday haha it's everywhere |
I'm planning to start looking at this today |
@kaicataldo FYI classes that extend native Map in |
Yeah we need to make a wrapper instead of extending |
So what's the status here ? I'd be willing to help with that. |
If you'd like to start looking into this, can go ahead. Might need to do it myself if its too involved but we'll see how it goes for you? Immediately you should see an error
Basically for that we need to not extend a native built-in? Or I guess we could just not compile classes for that specific fix. |
Ok, so i'll look into that and do my best, but i'll proceed with caution and probably consult a lot. |
@4rlekin Please feel free to take this on if you're willing. I have some personal things that I have to attend to at the moment and won't be able to get to this until next week at the earliest. |
Oops done in #5218! |
What
Almost every babel-x package right now has a dependency on
babel-runtime
.Example with babel-plugin-check-es2015-constants:
babel/packages/babel-plugin-check-es2015-constants/package.json
Line 12 in 3c2e9c0
Being able to remove this from all packages would help save time to install (especially npm 2/yarn).
The reason for doing this in the first place has to do with wanting to use built-ins like Symbol/Promise, etc which are not native to node 0.10/0.12. Now that we are on >= Node 4 we should be able to use the native ones.
We don't want to use a polyfill, so we choose to use babel-runtime + babel-plugin-transform-runtime. For more context: http://babeljs.io/docs/plugins/transform-runtime/#why
I think if we don't do this there will be a babel-runtime 7.0 and that won't dedupe correctly etc or we rename to babel-runtime-internal
How to:
transform-runtime
from the babel configbabel-runtime
from the "dependencies" in each package's package.json and at the top level package.jsonWins
cc @sindresorhus, @insin since I think I recall both of you wanting a solution this even from #3438.
The text was updated successfully, but these errors were encountered: