Skip to content
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

First-class support for module loaders #2364

Closed
davidjgoss opened this issue Dec 21, 2023 · 4 comments · Fixed by #2399
Closed

First-class support for module loaders #2364

davidjgoss opened this issue Dec 21, 2023 · 4 comments · Fixed by #2399
Assignees
Labels
✅ accepted The core team has agreed that it is a good idea to fix this ⚡ enhancement Request for new functionality

Comments

@davidjgoss
Copy link
Contributor

🤔 What's the problem you're trying to solve?

Use of ESM loaders without setting the --loader flag from outside the process, which is clunky at the best of times and now discouraged by Node.js in favour of using register() programatically.

✨ What's your proposed solution?

Add a loader option (with a --loader CLI counterpart) for specifying zero or more module loaders to register. Then, do this accordingly before doing any import() of support code. Kinda like requireModule.

This should be done for both serial and parallel runtime flavours.

⛏ Have you considered any alternatives or workarounds?

Leave it as it is and wait for things to be marked stable. This may happen anyway depending on how long it takes us to get to this.

📚 Any additional context?

register() is still marked as experimental so we need to tread carefully.

Relates back to the wider initiative to eventually transition to ESM only.


This text was originally generated from a template, then edited by hand. You can modify the template here.

@davidjgoss davidjgoss added ✅ accepted The core team has agreed that it is a good idea to fix this ⚡ enhancement Request for new functionality labels Dec 21, 2023
@paco-sparta
Copy link

This is a bit overdue, with ESM being a 10yo technology that's the baseline of most of the industry. Is there any way to sponsor it?

@davidjgoss
Copy link
Contributor Author

davidjgoss commented Apr 21, 2024

Thanks for the nudge @paco-sparta, you're right it's overdue. And I appreciate the offer to sponsor. We aren't currently set up to have individual pieces of work directly sponsored. But if you'd like to sponsor the project in general for any amount (including one-off), you can do so via GitHub Sponsors or OpenCollective. For clarity, I am going to ship this regardless and will aim to have it released pretty soon.

@davidjgoss
Copy link
Contributor Author

Released in https://github.com/cucumber/cucumber-js/releases/tag/v10.6.0

@paco-sparta
Copy link

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ accepted The core team has agreed that it is a good idea to fix this ⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants