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

chore: Release v8 as stable #979

Merged
merged 10 commits into from
Jun 23, 2021
Merged

chore: Release v8 as stable #979

merged 10 commits into from
Jun 23, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Jun 13, 2021

Recommendations:

  1. If you're using jest fake timers make sure you use modern timers
    jest 27:
    -jest.useFakeTimers('legacy')
    +jest.useFakeTimers('modern')
     // jest.config.js
    -"timers": "legacy",
    +"timers": "modern",
    jest 26:
    -jest.useFakeTimers()
    +jest.useFakeTimers('modern')
     // jest.config.js
    -"timers": "legacy",
    +"timers": "modern",

BREAKING CHANGE: Remove deprecated waitFormDOMChange

BREAKING CHANGE: Remove deprecated waitForElement

BREAKING CHANGE: The timeout in waitFor(callback, { interval, timeout } ) now uses the same clock as interval. Previously timeout was always using the real clock while interval was using the global clock which could've been mocked out. For the old behavior I'd recommend waitFor(callback, { interval, timeout: Number.POSITIVE_INFINITY }) and rely on your test runner to timeout considering real timers.

BREAKING CHANGE: <script />, <style /> and comment nodes are now ignored by default in prettyDOM .If you whish to return to the old behavior, use a custom filterNode function. In this case prettyDOM(element, { filterNode: () => true }).

BREAKING CHANGE: node 10 is no longer supported. It reached its end-of-life on 30.04.2021.

What:

Prepare new major release

Why:

Ran promising tests in

Merge (not squash&merge) alpha into main

Checklist:

eps1lon and others added 7 commits June 3, 2021 06:27
BREAKING CHANGE: Remove deprecated `waitFormDOMChange`

BREAKING CHANGE: The `timeout` in `waitFor(callback, { interval, timeout } )` now uses the same clock as `interval`. Previously `timeout` was always using the real clock while `interval` was using the global clock which could've been mocked out. For the old behavior I'd recommend `waitFor(callback, { interval, timeout: Number.PositiveInfinity })` and rely on your test runner to timeout considering real timers.
BREAKING CHANGE: Remove deprecated `waitForElement`
BREAKING CHANGE: node 10 is no longer supported. It reached its end-of-life on 30.04.2021.
@eps1lon eps1lon added the BREAKING CHANGE This change will require a major version bump label Jun 13, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 13, 2021

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 5b15f6f:

Sandbox Source
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Jun 13, 2021

Codecov Report

Merging #979 (5b15f6f) into main (56a4c75) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #979   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        25    -1     
  Lines          966       914   -52     
  Branches       298       281   -17     
=========================================
- Hits           966       914   -52     
Flag Coverage Δ
node-10.14.2 ?
node-12 100.00% <100.00%> (ø)
node-14 100.00% <100.00%> (ø)
node-15 ?
node-16 100.00% <100.00%> (ø)

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

Impacted Files Coverage Δ
src/role-helpers.js 100.00% <ø> (ø)
src/suggestions.js 100.00% <ø> (ø)
src/config.ts 100.00% <100.00%> (ø)
src/get-user-code-frame.js 100.00% <100.00%> (ø)
src/helpers.js 100.00% <100.00%> (ø)
src/pretty-dom.js 100.00% <100.00%> (ø)
src/queries/role.js 100.00% <100.00%> (ø)
src/queries/text.ts 100.00% <100.00%> (ø)
src/queries/title.ts 100.00% <100.00%> (ø)
src/query-helpers.js 100.00% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56a4c75...5b15f6f. Read the comment docs.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Should we also add a note that OptionsReceived is replaced with PrettyFormatOptions ?
I bumped against this problem while I was preparing the upgrade for Angular Testing Library.

@eps1lon
Copy link
Member Author

eps1lon commented Jun 17, 2021

Should we also add a note that OptionsReceived is replaced with PrettyFormatOptions ?

It's not a breaking change, no. You can still pass prettyFormat.OptionsReceived.

But we should rename it to PrettyDOMOptions. They're not options to pretty-format anymore.

Edit:
Make sure you're also using [email protected].

@eps1lon eps1lon changed the title chore: Release alpha as stable chore: Release v8 as stable Jun 20, 2021
@eps1lon eps1lon marked this pull request as ready for review June 20, 2021 08:08
@eps1lon eps1lon mentioned this pull request Jun 21, 2021
@kentcdodds
Copy link
Member

I'm currently testing the impact this will have on https://github.com/kentcdodds/bookshelf as well as another final test before giving this the green light.

@kentcdodds
Copy link
Member

As usual, react-query + jest fake timers is an issue (don't worry about the long time the test is taking, my computer is currently doing some other resource intensive video conversion):

image

I tried my react-query v3 branch and had the same issue. In both cases, if I remove the fake timers then the test passes just fine.

If I try to upgrade to jest 27, I get an error because this is a CRA app.

I'm guessing this means that the combination of these tools/versions is problematic, so I'll probably just need to lock the versions if I don't want to make some major changes which is ultimately inevitable anyway, so I will not block this release on that.

All the other tests for that app work without trouble.

Once this is ready to merge then I think we're good.

@eps1lon
Copy link
Member Author

eps1lon commented Jun 21, 2021

I think ultimately jest is missing an API for flushing the microtask queue. We were kind of hacking it with Promise.resolve + setImmediate which isn't even something that's available in a browser. The current hack isn't better though.

I'm hoping that we can offer a workaround in a feature release where people can implement their own clock and therefore go back to the old Promise.resolve(resolve => setImmediate(resolve)) implementation for flushing microtasks if they need to.

The main goal of this major is to make the behavior more predictable (e.g. no more mixing of clocks, no more usage of setImmediate which isn't even available in browsers).

Thanks for the hint about react-query though. I'll take that repo and your bookshelf app into consideration for future integration testing. I was focusing too much on libraries.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

I tested the latest alpha release in ATL and all tests are passing, using Jest 26.

@eps1lon eps1lon merged commit d347302 into main Jun 23, 2021
@eps1lon eps1lon deleted the alpha branch June 23, 2021 05:58
@github-actions
Copy link

🎉 This PR is included in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE This change will require a major version bump released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants