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

Switch to ESM #338

Merged
merged 11 commits into from
Nov 30, 2023
Merged

Switch to ESM #338

merged 11 commits into from
Nov 30, 2023

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Nov 29, 2023

🤔 What's changed?

This package is now an ES module (ESM), meaning the context you consume it in must support ESM. In practise, that's module bundlers like Webpack and Vite which is all fine, so there is no need to have the transitional step of a "hybrid" package like we have done with cucumber-js and our another Node.js-oriented packages.

The significant changes are to config and setup code, and some dependencies which needed bumping to fix issues with types etc. On the other hand, the majority of the diff is adding .js suffixes to relative imports in TS files, which looks weird but is correct (I switched on a lint rule so we always do that in future).

This is a big change and as such I've dropped this into html-formatter locally, built it and used it with cucumber-js and done some exploratory testing, and everything is working as expected.

Also whilst this will be exactly the same behaviour for end users of formatters, this should be released as a major since anyone directly using the components may have some config/tooling changes to adopt.

⚡️ What's your motivation?

This will enable us to consume ESM-only dependencies where we have recently been blocked on upgrading or adopting them.

Fixes #7

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, documentation etc. without changing behaviour)
  • 💥 Breaking change (incompatible changes to the API)

📋 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.

Copy link

netlify bot commented Nov 29, 2023

Deploy Preview for cucumber-react-components failed.

Name Link
🔨 Latest commit 231054c
🔍 Latest deploy log https://app.netlify.com/sites/cucumber-react-components/deploys/6567cb036572db00085745ad

@davidjgoss
Copy link
Contributor Author

(Ignore Netlify issues - these were already present and will be fixed by #337.)

@davidjgoss davidjgoss marked this pull request as ready for review November 29, 2023 23:40
@davidjgoss davidjgoss merged commit 600a576 into main Nov 30, 2023
1 of 5 checks passed
@davidjgoss davidjgoss deleted the feat/esm-only branch November 30, 2023 15:49
@davidjgoss davidjgoss mentioned this pull request Dec 2, 2023
7 tasks
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.

Make ESM module
1 participant