redhat-developer / redhat-developer/yaml-language-server
Switch to ESM
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
Is your enhancement related to a problem? Please describe.
Currently yaml-language-server is distributed as:
- CommonJS
- UMD
- Faux ESM
These are all outdated practices that aim to provide backwards compatibility for programmatic use. But in reality, they make the project harder to work with.
Describe the solution you would like
- Go ESM only
- Drop CommonJS support
- Drop UMD support
- Drop Node.js 20 support
- Replace Mocha with
node:test
Describe alternatives you have considered
- The use of
ts-nodewill likely be problematic. This is why I suggest to use Node.js type-stripping. - I don’t know how well Mocha works with Node.js type-stripping. This is why I suggest replace Mocha with
node:testand drop support for Node.js 20. An alternative would be to build the tests and running its build output.
Additional context
The current state of JavaScript modules is as follows:
- Node.js 12 added support for ESM.
- Node.js 20 added support for
require(esm). - Node.js 22 added support for type-stripping.
- TypeScript 6 is going to remove support for UMD.
- VSCode plans to move to ESM for its client libraries (https://github.com/microsoft/vscode/issues/192144#issuecomment-3595706764).
- The upcoming version 3 of the
yamlpackage will be ESM only (https://github.com/eemeli/yaml/issues/601). yaml-language-serveris tested against Node.js 20.- At the moment of writing, Node.js 20 is about to reach EOL.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or test paths are named. Begin by locating the current CommonJS, UMD, and ESM entry points and the Mocha-based test setup, then review how TypeScript, ts-node, and Node.js type-stripping are used; done means ESM-only distribution and tests running with node:test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- devtools, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100