-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Production dependencies update #4643
Conversation
@giltayar How do we handle this when a dependency migrates from CJS to a pure ESM package? |
@juergba there is no way to do this, other than to switch to an async path and use async I believe we should start thinking about migrating Mocha to be an async-only API in v10, which will allow us to use async This movement towards ESM-only is starting to gain some momentum, with at least two important OSS developers saying they're going full ESM by the end of 2021 (Sindre Sorhus and Titus). I believe Mocha should start thinking about also migrating to ESM only, maybe by the time 12 EOLs. Here are some of Sindre Sorhus' thoughts on this: https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77 |
1bcec3f
to
f0a9579
Compare
@snoack I had to remove your When rebuilding |
@juergba Apparently, they changed the boilerplate of
|
@snoack thank you for your reply, 😀. I was hoping to get an easy answer. Will this PR regenerator/396 offer any help as soon as merged? For the moment I'm going for option 1).
I will try to fix this first, and then set your hack back on duty. |
Yes, regenerator/396 should fix the cause of this issue. |
f0a9579
to
2fd4d0c
Compare
@snoack Pinning only the version of
Our tests have passed successfully now. Could you have a look, please? |
@juergba I feel you! I would seriously think of removing support for IE11 in v9. Whoever needs it can use Mocha v8, and it's getting EOL-d real soon now, so maintaining v8 for critical security vulnerabilities shouldn't be a problem. (but this is just my 2 cents. I definitely don't understand all the implications) |
IMO it's too early. But I'm starting to like the option with two seperate builds. For a short test I removed the transpiling step and locally the browser test succeeds. The bundled file is much smaller (20k lines instead of 30k).
and for later v9.* releases we add a second bundle:
We publish both files in our package on npm. www.unpkg.com is exposing our entire package, so both bundles would be available without breaking change. Edit: our browser tests are week, only units and no integration tests. So I don't really know wether modern browsers support ES2018 completely. |
Only pinning
Looks good. FWIW as I said before you can easily test this scenario by adding
Note that this would technically be a breaking change, since users would have to change the bundle name when udating to a newer version of Mocha (and then once again if you ever plan to rename |
I tried and it didn't work, since @babel/preset-env doesn't pin its sub-dependencies. I don't know wether we need all five packages though.
How can I run this test with my local bundle of |
01f3738
to
dfdfdef
Compare
Hmm, I tried it, and it did work. Note that
Did you try adding <meta http-equiv="Content-Security-Policy" content="script-src http: https: file: 'unsafe-inline'"> |
@snoack
Works, excellent! Thanks for your help. 👍 |
@snoack a few days ago a new release v0.13.9 of regenerator-runtime has been published with this commit. I applied following changes:
But the test you gave me, fails with Do you have any tip? Or is v0.13.9 just not the solution? |
Description
We update the production dependencies for our next major release v.9.0.0.
I could not upgrade following packages:
In there latest major releases these are pure ESM packages now. Since Mocha is a CJS package we can't simply replace the synchronous
require()
by the asynchronousimport()
. A challenge to be resolved ...After rebuilding package-lock.json the browser tests failed with:
and I had to remove the change of PR #4577 in rollup.config.js.
It's about
regenerator-runtime
which Babel uses to transpileasync/await
down to ES5.We evtl. have to find another solution for the
EvalError
when using Mocha in browser environment.Edit: At the end I did not revert PR #4577, but pinned the versions of our transpiling dependencies.