-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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(merge-styles): introduce DeepPartialV2
type to avoid infinite type instantiation and make unions declaration more performant
#31703
Merged
Hotell
merged 6 commits into
microsoft:master
from
Hotell:fix/v8/improve-infinite-type-issues
Jun 14, 2024
Merged
fix(merge-styles): introduce DeepPartialV2
type to avoid infinite type instantiation and make unions declaration more performant
#31703
Hotell
merged 6 commits into
microsoft:master
from
Hotell:fix/v8/improve-infinite-type-issues
Jun 14, 2024
Conversation
This file contains 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
Hotell
changed the title
Fix/v8/improve infinite type issues
fix(merge-styles): introduce safe Jun 13, 2024
DeepPartialV2
type, simplify union creation, mitigate recursion references
📊 Bundle size reportUnchanged fixtures
|
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
BaseButton | mount | 612 | 628 | 5000 | |
Breadcrumb | mount | 1664 | 1655 | 1000 | |
Checkbox | mount | 1690 | 1705 | 5000 | |
CheckboxBase | mount | 1489 | 1491 | 5000 | |
ChoiceGroup | mount | 2972 | 2903 | 5000 | |
ComboBox | mount | 689 | 704 | 1000 | |
CommandBar | mount | 6454 | 6553 | 1000 | |
ContextualMenu | mount | 13200 | 13433 | 1000 | |
DefaultButton | mount | 782 | 788 | 5000 | |
DetailsRow | mount | 2202 | 2247 | 5000 | |
DetailsRowFast | mount | 2235 | 2220 | 5000 | |
DetailsRowNoStyles | mount | 2038 | 2030 | 5000 | |
Dialog | mount | 2724 | 2778 | 1000 | |
DocumentCardTitle | mount | 232 | 237 | 1000 | |
Dropdown | mount | 1951 | 1990 | 5000 | |
FocusTrapZone | mount | 1141 | 1109 | 5000 | |
FocusZone | mount | 1065 | 1084 | 5000 | |
GroupedList | mount | 37803 | 42205 | 2 | |
GroupedList | virtual-rerender | 18001 | 20096 | 2 | |
GroupedList | virtual-rerender-with-unmount | 51734 | 51117 | 2 | |
GroupedListV2 | mount | 230 | 220 | 2 | |
GroupedListV2 | virtual-rerender | 205 | 216 | 2 | |
GroupedListV2 | virtual-rerender-with-unmount | 234 | 229 | 2 | |
IconButton | mount | 1117 | 1164 | 5000 | |
Label | mount | 345 | 350 | 5000 | |
Layer | mount | 2747 | 2744 | 5000 | |
Link | mount | 393 | 399 | 5000 | |
MenuButton | mount | 985 | 990 | 5000 | |
MessageBar | mount | 21145 | 21208 | 5000 | |
Nav | mount | 1980 | 1998 | 1000 | |
OverflowSet | mount | 798 | 781 | 5000 | |
Panel | mount | 1802 | 1782 | 1000 | |
Persona | mount | 755 | 758 | 1000 | |
Pivot | mount | 891 | 886 | 1000 | |
PrimaryButton | mount | 922 | 930 | 5000 | |
Rating | mount | 4598 | 4691 | 5000 | |
SearchBox | mount | 904 | 921 | 5000 | |
Shimmer | mount | 1897 | 1900 | 5000 | |
Slider | mount | 1320 | 1349 | 5000 | |
SpinButton | mount | 2993 | 2925 | 5000 | |
Spinner | mount | 384 | 390 | 5000 | |
SplitButton | mount | 1886 | 1850 | 5000 | |
Stack | mount | 409 | 411 | 5000 | |
StackWithIntrinsicChildren | mount | 852 | 889 | 5000 | |
StackWithTextChildren | mount | 2685 | 2713 | 5000 | |
SwatchColorPicker | mount | 6236 | 6384 | 5000 | |
TagPicker | mount | 1484 | 1479 | 5000 | |
Text | mount | 378 | 379 | 5000 | |
TextField | mount | 961 | 969 | 5000 | |
ThemeProvider | mount | 838 | 856 | 5000 | |
ThemeProvider | virtual-rerender | 586 | 581 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 1288 | 1262 | 5000 | |
Toggle | mount | 617 | 621 | 5000 | |
buttonNative | mount | 196 | 200 | 5000 |
Hotell
changed the title
fix(merge-styles): introduce safe
fix(merge-styles): introduce Jun 14, 2024
DeepPartialV2
type, simplify union creation, mitigate recursion referencesDeepPartialV2
type to avoid infinite type instantiation, simplify unions creation, mitigate recursion references
Hotell
changed the title
fix(merge-styles): introduce
fix(merge-styles): introduce Jun 14, 2024
DeepPartialV2
type to avoid infinite type instantiation, simplify unions creation, mitigate recursion referencesDeepPartialV2
type to avoid infinite type instantiation, simplify unions creation, mitigate circular type references
Hotell
added
Package: merge-styles
Area: Typescript
Fluent UI react (v8)
Issues about @fluentui/react (v8)
labels
Jun 14, 2024
Hotell
force-pushed
the
fix/v8/improve-infinite-type-issues
branch
from
June 14, 2024 10:06
4f60035
to
a30d326
Compare
fabricteam
reviewed
Jun 14, 2024
Hotell
commented
Jun 14, 2024
Hotell
commented
Jun 14, 2024
Hotell
changed the title
fix(merge-styles): introduce
fix(merge-styles): introduce Jun 14, 2024
DeepPartialV2
type to avoid infinite type instantiation, simplify unions creation, mitigate circular type referencesDeepPartialV2
type to avoid infinite type instantiation and simplify unions creation
Hotell
changed the title
fix(merge-styles): introduce
fix(merge-styles): introduce Jun 14, 2024
DeepPartialV2
type to avoid infinite type instantiation and simplify unions creationDeepPartialV2
type to avoid infinite type instantiation and make unions declaration more performant
Hotell
commented
Jun 14, 2024
spmonahan
approved these changes
Jun 14, 2024
miroslavstastny
pushed a commit
to miroslavstastny/fluentui
that referenced
this pull request
Jun 14, 2024
…ype instantiation and make unions declaration more performant (microsoft#31703)
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Previous Behavior
New Behavior
This PR mitigates
TS2589: Type instantiation is excessively deep and possibly infinite.
Error that our users started to run into after adding opt in ShadowDom functionality into v8 styling system (#30689)DeepPartialV2
is used within codebase instead of problematicDeepPartial
DeepPartial
is marked@deprecated
as we cannot remove it because it's exposed as part of public APIOmit
to_Omit
to be explicit about it's not from ts.libisShadowConfig
type predicate internals have been improved for more robust runtime check (that's causing tiny bundle size bump )Summary:
Related Issue(s)
@fluentui/react
(Fluent v8) #30689