esm.sh
esm.sh copied to clipboard
The unit test success rate for esm.sh is lower after refactoring
Hey, @ije nice try for esm.sh 's refactoring to transform node eval to ast parser.
Better for some package like: /@lume/element, /@lume/variable.
But bad for some packages too, here is the details:
Online Test for current esm.sh : 66.23%

Online Test for (esm.alibaba-inc.com) which is based on old version: 89.61%

Maybe we need node eval and ast parser both for named export & packaging depends on different situations.
@zhoukekestar i think the AST parser is ok, guess the main problem is that i updated esbuild to 0.11, the external module resolver needs to be updated too becuase i saw a lot require is not defined errors, i will fix it asap, thanks 🙏 btw the testing looks amazing, can you please share it with me?
Thanks for your hard working, the unit test is very simple which is written in native JavaScript. I will open-source it if you need this so that we can deliver esm.sh with more confidence.
i added a simple testing page, do you have interest in improving it? thanks
you can update it in here: https://github.com/postui/esm.sh/blob/master/embed/test/testing.js
run the testing in http://localhost/?test
btw, i added a build queue instead of the mutex lock that can use the multiple CPU units. in my computer (i7 8 cores) it got almost 7x build speed faster!
Great, that's awesome!
Some hack details maybe useful for you to pass all unit test:
- named export solution PRed by @wleonardo
- some npm packaged by webpack
- some npm use browser entry directly. For example: https://unpkg.com/browse/[email protected]/browser.mjs
- some necessary polyfill like: @jspm/core & entends it. For example: https://github.com/jspm/jspm-core/issues/13
- some named export like
argumentsseems NO-SOLUTION for it, and may be the only way is useis.default.arguments. For example: https://github.com/postui/esm.sh/issues/28