fedwiki / wiki-client

Federated wiki client-side javascript as a npm module.
Other
117 stars 38 forks source link

Spike6 #330

Open SamAxe opened 4 days ago

SamAxe commented 4 days ago

This is a proof of concept/work in progress of converting to ES6 modules, not ready for merging, but here for sharing and commenting and suggesting...

Node23.x adds new support for, require(esm), https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/ and https://nodejs.org/en/blog/announcements/v22-release-announce#support-requireing-synchronous-esm-graphs, to the require word that supports importing es6 modules from commonJS files, which was previously not possible. Thus, I thought it might be possible to do an incremental conversion on a file by file basis to ES6 modules.

I'm using yarn build and yarn runtests to check the work. The runtests target does result in some pending operations. I've probably gone a bit past my JavaScript skills with this attempt...