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(deps): update dev dependencies #2830

Merged
merged 11 commits into from
Nov 20, 2024
Merged

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Nov 18, 2024

for v2.10.3

with patching RTL for react 19-rc.1.

Copy link

vercel bot commented Nov 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jotai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 11:07am

Copy link

codesandbox-ci bot commented Nov 18, 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.

Copy link

github-actions bot commented Nov 18, 2024

Size Change: +4 B (0%)

Total Size: 90.8 kB

Filename Size Change
./dist/esm/react.mjs 1.4 kB +1 B (+0.07%)
./dist/system/react.development.js 1.56 kB +1 B (+0.06%)
./dist/system/react.production.js 865 B +2 B (+0.23%)
ℹ️ View Unchanged
Filename Size
./dist/babel/plugin-debug-label.js 932 B
./dist/babel/plugin-react-refresh.js 1.14 kB
./dist/babel/preset.js 1.41 kB
./dist/esm/babel/plugin-debug-label.mjs 1 kB
./dist/esm/babel/plugin-react-refresh.mjs 1.19 kB
./dist/esm/babel/preset.mjs 1.49 kB
./dist/esm/index.mjs 62 B
./dist/esm/react/utils.mjs 746 B
./dist/esm/utils.mjs 67 B
./dist/esm/vanilla.mjs 3.99 kB
./dist/esm/vanilla/utils.mjs 5.04 kB
./dist/index.js 242 B
./dist/react.js 1.44 kB
./dist/react/utils.js 1.39 kB
./dist/system/babel/plugin-debug-label.development.js 1.1 kB
./dist/system/babel/plugin-debug-label.production.js 775 B
./dist/system/babel/plugin-react-refresh.development.js 1.29 kB
./dist/system/babel/plugin-react-refresh.production.js 928 B
./dist/system/babel/preset.development.js 1.59 kB
./dist/system/babel/preset.production.js 1.14 kB
./dist/system/index.development.js 252 B
./dist/system/index.production.js 183 B
./dist/system/react/utils.development.js 860 B
./dist/system/react/utils.production.js 462 B
./dist/system/utils.development.js 257 B
./dist/system/utils.production.js 187 B
./dist/system/vanilla.development.js 4.08 kB
./dist/system/vanilla.production.js 2.14 kB
./dist/system/vanilla/utils.development.js 5.25 kB
./dist/system/vanilla/utils.production.js 3.14 kB
./dist/umd/babel/plugin-debug-label.development.js 1.08 kB
./dist/umd/babel/plugin-debug-label.production.js 852 B
./dist/umd/babel/plugin-react-refresh.development.js 1.27 kB
./dist/umd/babel/plugin-react-refresh.production.js 1 kB
./dist/umd/babel/preset.development.js 1.54 kB
./dist/umd/babel/preset.production.js 1.22 kB
./dist/umd/index.development.js 383 B
./dist/umd/index.production.js 328 B
./dist/umd/react.development.js 1.56 kB
./dist/umd/react.production.js 934 B
./dist/umd/react/utils.development.js 1.53 kB
./dist/umd/react/utils.production.js 1.01 kB
./dist/umd/utils.development.js 399 B
./dist/umd/utils.production.js 342 B
./dist/umd/vanilla.development.js 5.32 kB
./dist/umd/vanilla.production.js 2.84 kB
./dist/umd/vanilla/utils.development.js 6.24 kB
./dist/umd/vanilla/utils.production.js 3.78 kB
./dist/utils.js 247 B
./dist/vanilla.js 5.22 kB
./dist/vanilla/utils.js 6.1 kB

compressed-size-action

Copy link

github-actions bot commented Nov 18, 2024

LiveCodes Preview in LiveCodes

Latest commit: d7c46c2
Last updated: Nov 20, 2024 11:06am (UTC)

Playground Link
React demo https://livecodes.io?x=id/F36RFCHDB

See documentations for usage instructions.

"react": "19.0.0-rc.0",
"react-dom": "19.0.0-rc.0",
"rollup": "^4.25.0",
"react": "19.0.0-rc.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

Updating react to rc.1 makes tests to fail.

@kretajak I wonder if you are familiar with this case. Do we misuse RTL for async tests?

Copy link
Contributor

@kretajak kretajak Nov 18, 2024

Choose a reason for hiding this comment

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

I will take a look at that. The way RTL is used here to test async stuff is fine from my perspective.

Copy link
Contributor

@kretajak kretajak Nov 18, 2024

Choose a reason for hiding this comment

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

Looks like broken tests are using Suspense and Suspense behavior was changed in RC1 (facebook/react#29898 (comment)).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for taking a look. I know the Suspense behavior was changed, but didn't consider if it really broke it.

https://stackblitz.com/edit/vitejs-vite-hbi7w9?file=src%2FApp.tsx&terminal=dev This looks like working. So, it's probably test only issue.

- 0.0.0-experimental-5c56b873-20241107
- 19.0.0-rc.1
- 19.0.0-rc-e1ef8c95-20241115
- 0.0.0-experimental-e1ef8c95-20241115
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's the list of commits for the change:

facebook/react@5c56b87...e1ef8c9

Copy link
Member Author

Choose a reason for hiding this comment

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

More precisely, it's between these commit that cause the error:
facebook/react@380f5d6...b01722d

Copy link
Member Author

Choose a reason for hiding this comment

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

So, enableSiblingPrerendering should only be the meaningful change.

@@ -34,6 +36,28 @@ const useCommitCount = () => {
return commitCountRef.current
}

/* eslint-disable testing-library/no-unnecessary-act */
const renderRoot = async (element: ReactNode) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only hack I came up with. If it looks good, I'll work on other files too.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's interesting why it works, especially as render from RTL and userEvent methods are already wrapped with act. Kent C Dodds mentions it as bad practice.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like we should await all act(). render from RTL throws away the promise from act() call.
https://github.com/testing-library/react-testing-library/blob/main/src/pure.js#L145

This workaround isn't ideal because we can't test the initial "Loading...".

Copy link
Member Author

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

It's very tricky, but for now, it seems to pass the CI.

wrapper: WrapperComponent
}) {
- (0, _actCompat.default)(() => {
+ await (0, _actCompat.default)(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

As it turns out, this helps.

Comment on lines +8 to +11
const userEvent = {
// eslint-disable-next-line testing-library/no-unnecessary-act
click: (element: Element) => act(() => userEventOrig.click(element)),
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I hoped to patch user-event too, but didn't find an easy way.

@dai-shi dai-shi marked this pull request as ready for review November 20, 2024 02:33
@dai-shi dai-shi merged commit 6a854a9 into main Nov 20, 2024
40 checks passed
@dai-shi dai-shi deleted the chore/update-dev-dependnecies branch November 20, 2024 11:17
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.

2 participants