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

Add support for ESM loaders #2399

Merged
merged 25 commits into from Apr 25, 2024
Merged

Add support for ESM loaders #2399

merged 25 commits into from Apr 25, 2024

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Apr 22, 2024

🤔 What's changed?

Adds a loader option to register loader hooks ahead of importing user code.

Updates documentation accordingly and also refreshes broader ESM documentation which was a little stale.

Also, makes the whole support block in the loadSupport and runCucumber API functions usable as a partial object - you can specify any/all of its props and it will default the rest. This is a pattern we should consider rolling out to the other blocks of the API options, otherwise we'll be making breaking changes whenever we add new props.

⚡️ What's your motivation?

Fixes #2364.

WIll provide a much better UX for folks doing TypeScript+ESM.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

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

@davidjgoss davidjgoss changed the title Feat/loader option Add support for ESM loaders Apr 22, 2024
@coveralls
Copy link

coveralls commented Apr 22, 2024

Coverage Status

coverage: 98.402% (+0.007%) from 98.395%
when pulling 3f259fe on feat/loader-option
into 8f96d9f on main.

@davidjgoss davidjgoss marked this pull request as ready for review April 22, 2024 19:45
@davidjgoss davidjgoss merged commit 2e51aed into main Apr 25, 2024
8 checks passed
@davidjgoss davidjgoss deleted the feat/loader-option branch April 25, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First-class support for module loaders
3 participants