-
Notifications
You must be signed in to change notification settings - Fork 77
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
Revisit Compatibility #435
Comments
I re-organized the list of ideas in my comment above and split them in two groups: short and mid-term ideas, and long-term ones. The long term is related to the timeline of enabling ES module support in Node without any flags. ES modules supported was unflagged in Node 13, which means that the first LTS to have it will be Node 14. Sadly, this also means that for the next two years we'll also have to deal with Node 10 and Node 12. At the same time, it's not a big issue and the In the shorter term, I'd like to focus on simplifying the build system. In #376 I've been tracking my progress migrating I don't think we should completely drop Rollup, as suggested in one of the ideas in my earlier comment. It's useful to be able to bundle all code into a single file and use that for a quick experimentation, or for a project which doesn't use a build system. I think we could also use that single file as a CommonJS-specific entry point for Node apps. If we called it Finally, I've been thinking about building a suite of integration tests. It appears that there are paid-for solutions like BrowserStack which could be useful for running the suite on multiple versions of browsers. Or, we could try to set up dockerized Selenium ourselves. But I do wonder if that wouldn't be an overkill. I haven't seen such extensive compatibility testing done for library projects. |
(Previous discussions: #133, #269)
Summary
I'd like to start a long-term clean-up project which aims at the following:
compat.js
builds.The Status Quo and Its Problems
.mjs
or files under a folder hierarchy with apackage.json
with{"type": "module"}
can beimported
rather thanrequired
.<script type="module">
.compat.js
build.preset-env
to define what should be transpiled. The browser matrix was chosen not based on usage data, but based on the JS features we didn't want to transpile. That's kind of backwards of howpreset-env
should work.require
.@babel/plugin-transform-es2015-modules-commonjs
oresm
.Short and Mid-Term Ideas
I'd like the clean-up to be careful and incremental. In no particular order:
compat.js
builds and run it in different versions of Node and older browsers without any further transpilation.preset-env
and transpile toES2017
which we effectively do right now anyways.target
compiler flag.Long-Term Ideas
Some further ideas for when all Node LTS versions support ES Modules without flags (from mid-2022 forward).
esm
and@babel/plugin-transform-es2015-modules-commonjs
when running tests.The text was updated successfully, but these errors were encountered: