Coachmark - useOffsetHeight should cause re-render on each set state to match v7 functionality#24702
Merged
micahgodbolt merged 4 commits intomicrosoft:masterfrom Sep 8, 2022
Merged
Conversation
|
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 d2d5f89:
|
Asset size changes
Baseline commit: 4c31b27421360e80d8435235092a634a67b0418a (build) |
Collaborator
📊 Bundle size report🤖 This report was generated against 4c31b27421360e80d8435235092a634a67b0418a |
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| BaseButton | mount | 1094 | 1042 | 5000 | |
| Breadcrumb | mount | 3186 | 3052 | 1000 | |
| Checkbox | mount | 3005 | 2969 | 5000 | |
| CheckboxBase | mount | 2609 | 2634 | 5000 | |
| ChoiceGroup | mount | 5615 | 5468 | 5000 | |
| ComboBox | mount | 1073 | 1088 | 1000 | |
| CommandBar | mount | 11964 | 11502 | 1000 | |
| ContextualMenu | mount | 13357 | 13521 | 1000 | |
| DefaultButton | mount | 1360 | 1377 | 5000 | |
| DetailsRow | mount | 4415 | 4346 | 5000 | |
| DetailsRowFast | mount | 4490 | 4373 | 5000 | |
| DetailsRowNoStyles | mount | 4187 | 4136 | 5000 | |
| Dialog | mount | 3432 | 3367 | 1000 | |
| DocumentCardTitle | mount | 217 | 243 | 1000 | |
| Dropdown | mount | 4151 | 3830 | 5000 | |
| FocusTrapZone | mount | 2252 | 2147 | 5000 | |
| FocusZone | mount | 1970 | 1987 | 5000 | |
| IconButton | mount | 2053 | 2094 | 5000 | |
| Label | mount | 413 | 395 | 5000 | |
| Layer | mount | 4974 | 4999 | 5000 | |
| Link | mount | 540 | 523 | 5000 | |
| MenuButton | mount | 1790 | 1838 | 5000 | |
| MessageBar | mount | 2436 | 2387 | 5000 | |
| Nav | mount | 3757 | 3767 | 1000 | |
| OverflowSet | mount | 1229 | 1234 | 5000 | |
| Panel | mount | 2798 | 2770 | 1000 | |
| Persona | mount | 1087 | 1116 | 1000 | |
| Pivot | mount | 1600 | 1621 | 1000 | |
| PrimaryButton | mount | 1514 | 1501 | 5000 | |
| Rating | mount | 9084 | 9135 | 5000 | |
| SearchBox | mount | 1571 | 1563 | 5000 | |
| Shimmer | mount | 3485 | 3305 | 5000 | |
| Slider | mount | 2208 | 2199 | 5000 | |
| SpinButton | mount | 5655 | 5846 | 5000 | |
| Spinner | mount | 505 | 514 | 5000 | |
| SplitButton | mount | 3619 | 3568 | 5000 | |
| Stack | mount | 572 | 576 | 5000 | |
| StackWithIntrinsicChildren | mount | 2785 | 2831 | 5000 | |
| StackWithTextChildren | mount | 6232 | 6175 | 5000 | |
| SwatchColorPicker | mount | 13126 | 13416 | 5000 | |
| TagPicker | mount | 3016 | 3087 | 5000 | |
| TeachingBubble | mount | 108802 | 108595 | 5000 | |
| Text | mount | 502 | 506 | 5000 | |
| TextField | mount | 1558 | 1610 | 5000 | |
| ThemeProvider | mount | 1416 | 1361 | 5000 | |
| ThemeProvider | virtual-rerender | 802 | 830 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 2222 | 2191 | 5000 | |
| Toggle | mount | 947 | 966 | 5000 | |
| buttonNative | mount | 140 | 154 | 5000 |
spmonahan
approved these changes
Sep 8, 2022
sopranopillow
approved these changes
Sep 8, 2022
marcosmoura
added a commit
to marcosmoura/fluentui
that referenced
this pull request
Sep 9, 2022
* master: (63 commits) feat: add helper types to assist DOM element handling (microsoft#24722) applying package updates Textarea/hc bug (microsoft#24701) Fix null ref in use slider (microsoft#24728) Add Field unit tests, and remove snapshot tests (microsoft#24706) Stress Test: add build commands (microsoft#24575) Coachmark - useOffsetHeight should cause re-render on each set state to match v7 functionality (microsoft#24702) Implement screener tests for Field components (microsoft#24684) Update Field types to clean up react-field.api.md (microsoft#24703) fix(Popup): remove rotate(360deg) from PopupContent content styles (microsoft#24432) fix(FocusZone): should reset tabindex when focus is outside the zone with prop `shouldResetActiveElementWhenTabFromZone` (microsoft#24463) Fix greyed out legend key contrast ratio (microsoft#24714) fix: Portal compat should apply `focus-visible` ponyfill (microsoft#24712) Fix artifact error (microsoft#24717) chore(react-dialog): remove localShorthands in favor of griffel shorthands (microsoft#24715) Skip screener checks for draft PRs with exception of appropriately la… (microsoft#24694) fix: Remove provider classname from focus styles (microsoft#24710) feat: autocontrolled `useTable` hook (microsoft#24688) feat: add dialog properties to getNativeElementProps (microsoft#24698) Using migrate rather than upgrade term (microsoft#24695) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #23545
In v7 (class based)
_setHeightOffsetEveryFramewould callsetStateand updateheightOffsetregardless of if this value changed or not. This causecomponentDidUpdateto fire and for the positioning logic to update the coachmark as the size changed.In v8 (hooks based), the same logic, ran in
useHeightOffsetwould callsetHeightOffset, but if the value did not change, the component would not re-render.To solve this problem, I'm storing and retrieving the value in an object, which will always be different, and always cause a re-render.