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

🏷️ Better typings for constant #4999

Merged
merged 3 commits into from
May 21, 2024
Merged

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented May 17, 2024

Description

As recommended by #4047, let's leverage const generics to make usage of constant even simpler for TS users.

Not really a breaking change on its own but given we play with types and change the way we declare some, let's be safe and pack this change with other "next major" devs.

Checklist β€” Don't delete this checklist and make sure you do the following before opening the PR

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

Advanced

  • Category: 🏷️ Add or update types
  • Impacts: Typings

Copy link

codesandbox-ci bot commented May 17, 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 9864176:

Sandbox Source
@fast-check/examples Configuration

Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 96.73%. Comparing base (f21f43d) to head (9864176).

Additional details and impacted files
@@             Coverage Diff              @@
##           next-3_18_0    #4999   +/-   ##
============================================
  Coverage        96.73%   96.73%           
============================================
  Files              213      213           
  Lines            16252    16252           
  Branches          2652     2652           
============================================
  Hits             15721    15721           
  Misses             531      531           
Flag Coverage Ξ”
unit-tests 96.73% <100.00%> (ΓΈ)
unit-tests-18.x-Linux 96.70% <100.00%> (-0.04%) ⬇️
unit-tests-20.x-Linux 96.73% <100.00%> (ΓΈ)
unit-tests-22.x-Linux 96.73% <100.00%> (ΓΈ)
unit-tests-latest-Linux 96.73% <100.00%> (ΓΈ)

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.

Copy link
Contributor

πŸ‘‹ A preview of the new documentation is available at: http://664c462f56a6519ceb08f739--dubzzz-fast-check.netlify.app

@@ -119,7 +119,7 @@ describe('webUrl (integration)', () => {
function webUrlConstraintsBuilder(onlySmall?: boolean): fc.Arbitrary<WebUrlConstraints> {
return fc.record(
{
validSchemes: fc.constant(['ftp']),
validSchemes: fc.constant<string[]>(['ftp']),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #5007

@dubzzz dubzzz merged commit 9911e47 into next-3_18_0 May 21, 2024
73 of 74 checks passed
@dubzzz dubzzz deleted the constify-constant branch May 21, 2024 07:28
dubzzz added a commit that referenced this pull request May 29, 2024
**Description**

As recommended by #4047,
let's leverage const generics to make usage of `constant` even simpler
for TS users.

Not really a breaking change on its own but given we play with types and
change the way we declare some, let's be safe and pack this change with
other "next major" devs.

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

<!-- * 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: 🏷️ Add or update types
- [x] Impacts: Typings

<!-- [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?
-->
dubzzz added a commit that referenced this pull request Jul 16, 2024
**Description**

As recommended by #4047,
let's leverage const generics to make usage of `constant` even simpler
for TS users.

Not really a breaking change on its own but given we play with types and
change the way we declare some, let's be safe and pack this change with
other "next major" devs.

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

<!-- * 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: 🏷️ Add or update types
- [x] Impacts: Typings

<!-- [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?
-->
dubzzz added a commit that referenced this pull request Aug 13, 2024
**Description**

As recommended by #4047,
let's leverage const generics to make usage of `constant` even simpler
for TS users.

Not really a breaking change on its own but given we play with types and
change the way we declare some, let's be safe and pack this change with
other "next major" devs.

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

<!-- * 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: 🏷️ Add or update types
- [x] Impacts: Typings

<!-- [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?
-->
dubzzz added a commit that referenced this pull request Sep 23, 2024
**Description**

As recommended by #4047,
let's leverage const generics to make usage of `constant` even simpler
for TS users.

Not really a breaking change on its own but given we play with types and
change the way we declare some, let's be safe and pack this change with
other "next major" devs.

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

<!-- * 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: 🏷️ Add or update types
- [x] Impacts: Typings

<!-- [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?
-->
dubzzz added a commit that referenced this pull request Nov 6, 2024
**Description**

As recommended by #4047,
let's leverage const generics to make usage of `constant` even simpler
for TS users.

Not really a breaking change on its own but given we play with types and
change the way we declare some, let's be safe and pack this change with
other "next major" devs.

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

<!-- * 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: 🏷️ Add or update types
- [x] Impacts: Typings

<!-- [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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant