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

👷 Move build chain to ESM #4592

Closed
wants to merge 16 commits into from
Closed

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Jan 2, 2024

⚠️ Minor breaking change

The build chain of fast-check has been CommonJS-based since day 1. With ESM moving forward in the ecosystem, it's time to move ourselves to the new standard and adapt our build chains to ESM.

Unfortunately it may have some subtle impacts on our users as our package will not be a CJS one offering a ESM fallback anymore. I will rather be the opposite: an ESM package with a fallback to CJS. It implies that we moved ESM related files closer to the root of the package (we could have kept them in esm/) and moved the CJS ones further in the file structure (we had to move them).

Another subtle impact is that it would impose our users to run at least Node ≥12.17.0.

As such we consider it as a breaking change. On its own it should not be a huge problem for most of the users but given it changes our minimal requirement let's put it into the next major release.

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

**⚠️ Minor breaking change**

The build chain of `fast-check` has been CommonJS-based since day 1. With ESM moving forward in the ecosystem, it's time to move ourselves to the new standard and adapt our build chains to ESM.

Unfortunately it may have some subtle impacts on our users as our package will not be a CJS one offering a ESM fallback anymore. I will rather be the opposite: an ESM package with a fallback to CJS. It implies that we moved ESM related files closer to the root of the package (we could have kept them in esm/) and moved the CJS ones further in the file structure (we had to move them).

Another subtle impact is that it would impose our users to run at least Node ≥12.17.0.

As such we consider it as a breaking change. On its own it should not be a huge problem for most of the users but given it changes our minimal requirement let's put it into the next major release.
Copy link

codesandbox-ci bot commented Jan 2, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6e55fac:

Sandbox Source
@fast-check/examples Configuration

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.39%. Comparing base (f125086) to head (c7e81cc).

❗ Current head c7e81cc differs from pull request most recent head 6e55fac. Consider uploading reports for the commit 6e55fac to get more accurate results

Additional details and impacted files
@@               Coverage Diff               @@
##           next-3_15_0    #4592      +/-   ##
===============================================
- Coverage        93.39%   93.39%   -0.01%     
===============================================
  Files              207      207              
  Lines             5013     5009       -4     
  Branches          1353     1352       -1     
===============================================
- Hits              4682     4678       -4     
  Misses             331      331              
Flag Coverage Δ
unit-tests 93.39% <ø> (-0.01%) ⬇️
unit-tests-18.x-Linux 93.39% <ø> (-0.01%) ⬇️
unit-tests-20.x-Linux ?
unit-tests-latest-Linux ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dubzzz
Copy link
Owner Author

dubzzz commented Feb 19, 2024

🟢 e2e
🔴 units/arbitrary (73/135 spec files still failing)
🟢 units/check
🟢 units/random
🟢 units/stream
🟢 unit/stubs
🟢 unit/utils

@dubzzz
Copy link
Owner Author

dubzzz commented Mar 12, 2024

No valid jest.requireActual for now. I'll jest.requireActual on the CJS bundle even if not ideal, and I'll move to the new behaviour provided by Jest once ready.

Updated status at jestjs/jest#9430

dubzzz added a commit that referenced this pull request Feb 6, 2025
@dubzzz dubzzz mentioned this pull request Feb 6, 2025
8 tasks
@dubzzz dubzzz closed this Feb 6, 2025
@dubzzz dubzzz deleted the esm-build-chain-fast-check branch February 6, 2025 01:17
dubzzz added a commit that referenced this pull request Feb 6, 2025
**Description**

<!-- Please provide a short description and potentially linked issues
justifying the need for this PR -->

The build chain of fast-check has been CommonJS-based since day 1. With
ESM moving forward in the ecosystem, it's time to move ourselves to the
new standard and adapt our build chains to ESM.

Unfortunately it may have some subtle impacts on our users as our
package will not be a CJS one offering a ESM fallback anymore. I will
rather be the opposite: an ESM package with a fallback to CJS. It
implies that we moved ESM related files closer to the root of the
package (we could have kept them in esm/) and moved the CJS ones further
in the file structure (we had to move them).

Another subtle impact is that it would impose our users to run at least
Node ≥12.17.0.

As such we consider it as a breaking change. On its own it should not be
a huge problem for most of the users but given it changes our minimal
requirement let's put it into the next major release.

Superseed #4592

<!-- * Your PR is fixing a bug or regression? Check for existing issues
related to this bug and link them -->
<!-- * Your PR is adding a new feature? Make sure there is a related
issue or discussion attached to it -->

<!-- You can provide any additional context to help into understanding
what's this PR is attempting to solve: reproduction of a bug, code
snippets... -->

**Checklist** — _Don't delete this checklist and make sure you do the
following before opening the PR_

- [x] The name of my PR follows [gitmoji](https://gitmoji.dev/)
specification
- [x] My PR references one of several related issues (if any)
- [x] New features or breaking changes must come with an associated
Issue or Discussion
- [x] My PR does not add any new dependency without an associated Issue
or Discussion
- [x] My PR includes bumps details, please run `yarn bump` and flag the
impacts properly
- [x] My PR adds relevant tests and they would have failed without my PR
(when applicable)

<!-- More about contributing at
https://github.com/dubzzz/fast-check/blob/main/CONTRIBUTING.md -->

**Advanced**

<!-- How to fill the advanced section is detailed below! -->

- [x] Category: 👷 Configuration of the package
- [x] Impacts: Requires users to rely on more recent versions of Node,
at least 12.17

<!-- [Category] Please use one of the categories below, it will help us
into better understanding the urgency of the PR -->
<!-- * ✨ Introduce new features -->
<!-- * 📝 Add or update documentation -->
<!-- * ✅ Add or update tests -->
<!-- * 🐛 Fix a bug -->
<!-- * 🏷️ Add or update types -->
<!-- * ⚡️ Improve performance -->
<!-- * _Other(s):_ ... -->

<!-- [Impacts] Please provide a comma separated list of the potential
impacts that might be introduced by this change -->
<!-- * Generated values: Can your change impact any of the existing
generators in terms of generated values, if so which ones? when? -->
<!-- * Shrink values: Can your change impact any of the existing
generators in terms of shrink values, if so which ones? when? -->
<!-- * Performance: Can it require some typings changes on user side?
Please give more details -->
<!-- * Typings: Is there a potential performance impact? In which cases?
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant