-
Notifications
You must be signed in to change notification settings - Fork 53
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
cjs & esm support #224
base: master
Are you sure you want to change the base?
cjs & esm support #224
Conversation
Codecov Report
@@ Coverage Diff @@
## master #224 +/- ##
=======================================
Coverage 82.14% 82.14%
=======================================
Files 46 46
Lines 1960 1960
Branches 465 440 -25
=======================================
Hits 1610 1610
Misses 348 348
Partials 2 2 Continue to review full report at Codecov.
|
Thanks for working on this. 👍 The comment above about it not being possible, I may be wrong on as I may have conflated Elder.js with how we build Elder.js projects. The core meaningful distinction I remember was that CJS allows the code to be executed before exporting the module. This is something we use aggressively on ElderGuide.com, FindEnergy.com, and other sites to get the most out of caching. In looking through the Elder.js codebase quickly I couldn't find an example of this happening.
Package UpdatesThanks for taking a shot at this. I know there are some issues with specific versions of Svelte and it may be worth us pinning some of the other packages as they have been responsible for esoteric issues that are hard to debug. My gut says we should do a |
Is there any will to resurrect this and work towards getting it merged? I think ESM is the way forward, as increasingly packages are going ESM-only. I was going to pull in remark-smartypants to do quote-curling in Markdown, but it's ESM only. I had to go resurrect a version of it from 2020, including pinning to an old version of Willing to help in any way I can. |
@markjaquith thanks for nudging this. Working on a major refactor of both the plugins and Elder.js core. It will be ESM and have full TS support. Absolutely huge undertaking as this move required moving all tests to esm as well which jest doesnt support. You can look at the Typescript branches in both projects… also the published beta on npm. Probably 3-4 weeks out due to things going on in my personal life and needing to rework the default template. The changes are almost big enough to warrant a 2.0 as there are a ton of other improvements as well. |
The build & tests pass with the added esm support.
Followed the technique in https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1
Note this this will require a major version update as the
package.json
"exports"
prop is used. In praxis, there will be no breaking changes unless a dependent imports from an internal module.From #216 (comment)
Not sure what core package does not support esm. The build & tests pass.