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

fix: updates should be synchronous in unit tests #30014

Merged

Conversation

ling1726
Copy link
Member

@ling1726 ling1726 commented Dec 6, 2023

React testing platforms will often output errors when state updates happen outside act Since there is nothing obvious to wait for we just avoid debouncing in unit test environments.

Adds tests to make sure that the synchronous update only happens in test environment

React testing platforms will often output errors when state updates happen outside `act`
Since there is nothing obvious to wait for we just avoid debouncing
in unit test environments.

Adds tests to make sure that the synchronous update only happens in test
environment
@ling1726 ling1726 marked this pull request as ready for review December 6, 2023 22:45
@ling1726 ling1726 requested a review from a team as a code owner December 6, 2023 22:45
@fabricteam
Copy link
Collaborator

fabricteam commented Dec 6, 2023

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender 64 67 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 646 680 5000
Button mount 335 315 5000
Field mount 1124 1134 5000
FluentProvider mount 701 713 5000
FluentProviderWithTheme mount 85 89 10
FluentProviderWithTheme virtual-rerender 64 67 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 82 89 10
MakeStyles mount 858 873 50000
Persona mount 1806 1722 5000
SpinButton mount 1391 1386 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Dec 6, 2023

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
priority-overflow
createOverflowManager
4.447 kB
1.853 kB
react-components
react-components: Button, FluentProvider & webLightTheme
69.816 kB
20.132 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
208.169 kB
59.517 kB
react-components
react-components: FluentProvider & webLightTheme
42.101 kB
13.957 kB
react-overflow
hooks only
12.837 kB
4.837 kB
react-portal-compat
PortalCompatProvider
6.822 kB
2.311 kB
🤖 This report was generated against a704aaca45c895f5c4b9e22d1ea5e731fe679107

Copy link

codesandbox-ci bot commented Dec 6, 2023

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 2bc9522:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

Copy link

size-auditor bot commented Dec 6, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: a704aaca45c895f5c4b9e22d1ea5e731fe679107 (build)

@ling1726 ling1726 enabled auto-merge (squash) December 7, 2023 10:53
@ling1726 ling1726 merged commit 841ad6a into microsoft:master Dec 7, 2023
24 checks passed
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.

None yet

3 participants