-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Update React to 16.14 #21769
Update React to 16.14 #21769
Conversation
de7bd81
to
ac90b4e
Compare
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 6d1bd27:
|
📊 Bundle size reportUnchanged fixtures
|
560420c
to
348647f
Compare
@layershifter I noticed with this upgrade, I'm getting errors due to changes from csstype 2 to 3, and unfortunately the fixes might affect public APIs. It looks like griffel still uses csstype 2, so I'm guessing you hit this before? Do you have any thoughts on what to do? |
Asset size changes
Over Tolerance (1024 B) Over Baseline Below Baseline New Removed 1 kB = 1000 B Baseline commit: db520179cfa98c0451a2b74affc7ea15f9238ac0 (build) |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 1410 | 1382 | 5000 | Possible regression |
BaseButton | mount | 1409 | 1482 | 5000 | Possible regression |
Breadcrumb | mount | 3359 | 3484 | 1000 | Possible regression |
ButtonNext | mount | 877 | 840 | 5000 | Possible regression |
Checkbox | mount | 2099 | 2058 | 5000 | Possible regression |
CheckboxBase | mount | 1835 | 1944 | 5000 | Possible regression |
ChoiceGroup | mount | 5937 | 5949 | 5000 | Possible regression |
ComboBox | mount | 1471 | 1455 | 1000 | Possible regression |
CommandBar | mount | 12280 | 12524 | 1000 | Possible regression |
ContextualMenu | mount | 24318 | 21756 | 1000 | Possible regression |
DefaultButton | mount | 1686 | 1674 | 5000 | Possible regression |
DetailsRow | mount | 4720 | 4790 | 5000 | Possible regression |
DetailsRowFast | mount | 4792 | 4780 | 5000 | Possible regression |
DetailsRowNoStyles | mount | 4550 | 4514 | 5000 | Possible regression |
Dialog | mount | 2852 | 2921 | 1000 | Possible regression |
DocumentCardTitle | mount | 509 | 476 | 1000 | Possible regression |
Dropdown | mount | 4198 | 4201 | 5000 | Possible regression |
FluentProviderNext | mount | 2430 | 2381 | 5000 | Possible regression |
FluentProviderWithTheme | mount | 446 | 437 | 10 | Possible regression |
FluentProviderWithTheme | virtual-rerender | 393 | 408 | 10 | Possible regression |
FluentProviderWithTheme | virtual-rerender-with-unmount | 498 | 491 | 10 | Possible regression |
FocusTrapZone | mount | 2337 | 2322 | 5000 | Possible regression |
FocusZone | mount | 2343 | 2406 | 5000 | Possible regression |
IconButton | mount | 2360 | 2434 | 5000 | Possible regression |
Label | mount | 681 | 704 | 5000 | Possible regression |
Layer | mount | 3783 | 3707 | 5000 | Possible regression |
Link | mount | 856 | 811 | 5000 | Possible regression |
MakeStyles | mount | 2157 | 2143 | 50000 | Possible regression |
MenuButton | mount | 2077 | 2117 | 5000 | Possible regression |
MessageBar | mount | 2450 | 2700 | 5000 | Possible regression |
Nav | mount | 4189 | 4211 | 1000 | Possible regression |
OverflowSet | mount | 1551 | 1542 | 5000 | Possible regression |
Panel | mount | 2776 | 2720 | 1000 | Possible regression |
Persona | mount | 1290 | 1319 | 1000 | Possible regression |
Pivot | mount | 1884 | 1967 | 1000 | Possible regression |
PrimaryButton | mount | 1873 | 1839 | 5000 | Possible regression |
Rating | mount | 9465 | 9480 | 5000 | Possible regression |
SearchBox | mount | 1869 | 1885 | 5000 | Possible regression |
Shimmer | mount | 3202 | 3315 | 5000 | Possible regression |
Slider | mount | 2540 | 2553 | 5000 | Possible regression |
SpinButton | mount | 6406 | 6125 | 5000 | Possible regression |
Spinner | mount | 793 | 741 | 5000 | Possible regression |
SplitButton | mount | 4060 | 4047 | 5000 | Possible regression |
Stack | mount | 908 | 939 | 5000 | Possible regression |
StackWithIntrinsicChildren | mount | 3207 | 3145 | 5000 | Possible regression |
StackWithTextChildren | mount | 6813 | 6713 | 5000 | Possible regression |
SwatchColorPicker | mount | 13812 | 13669 | 5000 | Possible regression |
TagPicker | mount | 3256 | 3267 | 5000 | Possible regression |
TeachingBubble | mount | 15125 | 123726 | 5000 | Possible regression |
Text | mount | 824 | 797 | 5000 | Possible regression |
TextField | mount | 1945 | 1938 | 5000 | Possible regression |
ThemeProvider | mount | 1665 | 1642 | 5000 | Possible regression |
ThemeProvider | virtual-rerender | 975 | 1062 | 5000 | Possible regression |
ThemeProvider | virtual-rerender-with-unmount | 2438 | 2429 | 5000 | Possible regression |
Toggle | mount | 1243 | 1227 | 5000 | Possible regression |
buttonNative | mount | 437 | 428 | 5000 | Possible regression |
All results
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 1410 | 1382 | 5000 | Possible regression |
BaseButton | mount | 1409 | 1482 | 5000 | Possible regression |
Breadcrumb | mount | 3359 | 3484 | 1000 | Possible regression |
ButtonNext | mount | 877 | 840 | 5000 | Possible regression |
Checkbox | mount | 2099 | 2058 | 5000 | Possible regression |
CheckboxBase | mount | 1835 | 1944 | 5000 | Possible regression |
ChoiceGroup | mount | 5937 | 5949 | 5000 | Possible regression |
ComboBox | mount | 1471 | 1455 | 1000 | Possible regression |
CommandBar | mount | 12280 | 12524 | 1000 | Possible regression |
ContextualMenu | mount | 24318 | 21756 | 1000 | Possible regression |
DefaultButton | mount | 1686 | 1674 | 5000 | Possible regression |
DetailsRow | mount | 4720 | 4790 | 5000 | Possible regression |
DetailsRowFast | mount | 4792 | 4780 | 5000 | Possible regression |
DetailsRowNoStyles | mount | 4550 | 4514 | 5000 | Possible regression |
Dialog | mount | 2852 | 2921 | 1000 | Possible regression |
DocumentCardTitle | mount | 509 | 476 | 1000 | Possible regression |
Dropdown | mount | 4198 | 4201 | 5000 | Possible regression |
FluentProviderNext | mount | 2430 | 2381 | 5000 | Possible regression |
FluentProviderWithTheme | mount | 446 | 437 | 10 | Possible regression |
FluentProviderWithTheme | virtual-rerender | 393 | 408 | 10 | Possible regression |
FluentProviderWithTheme | virtual-rerender-with-unmount | 498 | 491 | 10 | Possible regression |
FocusTrapZone | mount | 2337 | 2322 | 5000 | Possible regression |
FocusZone | mount | 2343 | 2406 | 5000 | Possible regression |
IconButton | mount | 2360 | 2434 | 5000 | Possible regression |
Label | mount | 681 | 704 | 5000 | Possible regression |
Layer | mount | 3783 | 3707 | 5000 | Possible regression |
Link | mount | 856 | 811 | 5000 | Possible regression |
MakeStyles | mount | 2157 | 2143 | 50000 | Possible regression |
MenuButton | mount | 2077 | 2117 | 5000 | Possible regression |
MessageBar | mount | 2450 | 2700 | 5000 | Possible regression |
Nav | mount | 4189 | 4211 | 1000 | Possible regression |
OverflowSet | mount | 1551 | 1542 | 5000 | Possible regression |
Panel | mount | 2776 | 2720 | 1000 | Possible regression |
Persona | mount | 1290 | 1319 | 1000 | Possible regression |
Pivot | mount | 1884 | 1967 | 1000 | Possible regression |
PrimaryButton | mount | 1873 | 1839 | 5000 | Possible regression |
Rating | mount | 9465 | 9480 | 5000 | Possible regression |
SearchBox | mount | 1869 | 1885 | 5000 | Possible regression |
Shimmer | mount | 3202 | 3315 | 5000 | Possible regression |
Slider | mount | 2540 | 2553 | 5000 | Possible regression |
SpinButton | mount | 6406 | 6125 | 5000 | Possible regression |
Spinner | mount | 793 | 741 | 5000 | Possible regression |
SplitButton | mount | 4060 | 4047 | 5000 | Possible regression |
Stack | mount | 908 | 939 | 5000 | Possible regression |
StackWithIntrinsicChildren | mount | 3207 | 3145 | 5000 | Possible regression |
StackWithTextChildren | mount | 6813 | 6713 | 5000 | Possible regression |
SwatchColorPicker | mount | 13812 | 13669 | 5000 | Possible regression |
TagPicker | mount | 3256 | 3267 | 5000 | Possible regression |
TeachingBubble | mount | 15125 | 123726 | 5000 | Possible regression |
Text | mount | 824 | 797 | 5000 | Possible regression |
TextField | mount | 1945 | 1938 | 5000 | Possible regression |
ThemeProvider | mount | 1665 | 1642 | 5000 | Possible regression |
ThemeProvider | virtual-rerender | 975 | 1062 | 5000 | Possible regression |
ThemeProvider | virtual-rerender-with-unmount | 2438 | 2429 | 5000 | Possible regression |
Toggle | mount | 1243 | 1227 | 5000 | Possible regression |
buttonNative | mount | 437 | 428 | 5000 | Possible regression |
@@ -59,7 +59,7 @@ export interface ISelectedItemProps<T> extends IPickerItemProps<T> { | |||
} | |||
|
|||
export type BaseSelectedItem = { | |||
key?: React.Key; | |||
key?: React.Key | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to match an update to the type of React.Attributes to include null in the key
a9f85e7
to
05e66db
Compare
Can you please update it for |
Griffel will use |
Sure, what should the version range be? react-dom 16.14 uses scheduler ^0.19.1, and 17 uses 0.20. One question about adding as a peer dep--although in reality scheduler should be available any time react-dom is, wouldn't there be an "unmet peer dependency" warning if people don't explicitly install scheduler in their repo as well? |
csstype 3 renames things like |
It's not used in Teams directly AFAIR, it should not be a big issue.
We use some other types there, we will handle this during upgrade. But nothing from |
@layershifter What do you think is the correct version of EDIT: I realized that for react-context-selector, since we allow React 16 or 17, it makes sense to also allow scheduler 0.19 or 0.20 to match. For react-bindings I just did 0.19 since that package still has only React 16 in peer deps. |
a447769
to
e1af16b
Compare
Perf Analysis (
|
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
AccordionMinimalPerf.default | 162 | 148 | 1.09:1 |
MenuMinimalPerf.default | 927 | 852 | 1.09:1 |
ChatMinimalPerf.default | 790 | 739 | 1.07:1 |
AttachmentMinimalPerf.default | 169 | 159 | 1.06:1 |
CardMinimalPerf.default | 594 | 568 | 1.05:1 |
AlertMinimalPerf.default | 281 | 271 | 1.04:1 |
CheckboxMinimalPerf.default | 2827 | 2720 | 1.04:1 |
ToolbarMinimalPerf.default | 962 | 929 | 1.04:1 |
ButtonOverridesMissPerf.default | 1733 | 1687 | 1.03:1 |
ButtonSlotsPerf.default | 555 | 540 | 1.03:1 |
EmbedMinimalPerf.default | 4305 | 4164 | 1.03:1 |
ListMinimalPerf.default | 534 | 519 | 1.03:1 |
ReactionMinimalPerf.default | 401 | 391 | 1.03:1 |
IconMinimalPerf.default | 630 | 614 | 1.03:1 |
VideoMinimalPerf.default | 652 | 630 | 1.03:1 |
MenuButtonMinimalPerf.default | 1721 | 1689 | 1.02:1 |
ProviderMinimalPerf.default | 1141 | 1119 | 1.02:1 |
AttachmentSlotsPerf.default | 1127 | 1119 | 1.01:1 |
CarouselMinimalPerf.default | 472 | 467 | 1.01:1 |
ChatDuplicateMessagesPerf.default | 306 | 304 | 1.01:1 |
HeaderMinimalPerf.default | 380 | 376 | 1.01:1 |
ListNestedPerf.default | 593 | 587 | 1.01:1 |
ListWith60ListItems.default | 666 | 657 | 1.01:1 |
RadioGroupMinimalPerf.default | 474 | 468 | 1.01:1 |
SkeletonMinimalPerf.default | 365 | 363 | 1.01:1 |
SliderMinimalPerf.default | 1708 | 1694 | 1.01:1 |
TableManyItemsPerf.default | 1924 | 1898 | 1.01:1 |
TableMinimalPerf.default | 413 | 409 | 1.01:1 |
TooltipMinimalPerf.default | 1028 | 1016 | 1.01:1 |
TreeWith60ListItems.default | 188 | 187 | 1.01:1 |
AnimationMinimalPerf.default | 552 | 552 | 1:1 |
AvatarMinimalPerf.default | 203 | 202 | 1:1 |
DropdownMinimalPerf.default | 3060 | 3046 | 1:1 |
HeaderSlotsPerf.default | 754 | 751 | 1:1 |
InputMinimalPerf.default | 1340 | 1339 | 1:1 |
LoaderMinimalPerf.default | 695 | 692 | 1:1 |
StatusMinimalPerf.default | 689 | 690 | 1:1 |
TextMinimalPerf.default | 355 | 354 | 1:1 |
CustomToolbarPrototype.default | 4124 | 4116 | 1:1 |
DialogMinimalPerf.default | 785 | 790 | 0.99:1 |
ItemLayoutMinimalPerf.default | 1231 | 1238 | 0.99:1 |
ProviderMergeThemesPerf.default | 1774 | 1798 | 0.99:1 |
SplitButtonMinimalPerf.default | 4393 | 4429 | 0.99:1 |
ChatWithPopoverPerf.default | 396 | 405 | 0.98:1 |
DatepickerMinimalPerf.default | 5653 | 5788 | 0.98:1 |
ImageMinimalPerf.default | 382 | 390 | 0.98:1 |
LayoutMinimalPerf.default | 365 | 373 | 0.98:1 |
PopupMinimalPerf.default | 645 | 655 | 0.98:1 |
RefMinimalPerf.default | 245 | 250 | 0.98:1 |
DividerMinimalPerf.default | 366 | 378 | 0.97:1 |
GridMinimalPerf.default | 340 | 349 | 0.97:1 |
LabelMinimalPerf.default | 384 | 394 | 0.97:1 |
RosterPerf.default | 1168 | 1201 | 0.97:1 |
SegmentMinimalPerf.default | 348 | 357 | 0.97:1 |
TreeMinimalPerf.default | 815 | 844 | 0.97:1 |
DropdownManyItemsPerf.default | 672 | 698 | 0.96:1 |
PortalMinimalPerf.default | 171 | 178 | 0.96:1 |
ButtonMinimalPerf.default | 175 | 184 | 0.95:1 |
BoxMinimalPerf.default | 340 | 363 | 0.94:1 |
FormMinimalPerf.default | 389 | 413 | 0.94:1 |
ListCommonPerf.default | 613 | 650 | 0.94:1 |
TextAreaMinimalPerf.default | 489 | 518 | 0.94:1 |
FlexMinimalPerf.default | 297 | 332 | 0.89:1 |
e1af16b
to
e6cb236
Compare
Sounds good 👍 |
c0c4b99
to
b46ece9
Compare
3858590
to
27b87d2
Compare
Build is green (at least until it gets merge conflicts from publishing), so @Hotell and/or @microsoft/cxe-prg and @microsoft/fluentui-react-build can you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#strengthAndHonor
27b87d2
to
859b9f4
Compare
4e0f967
to
0153d1a
Compare
0153d1a
to
6d1bd27
Compare
Current Behavior
We're not on the latest 16.x versions of React and related deps and types. This was causing some problems with the storybook upgrade PR (#21742), and although there are other possible workarounds for those issues, it's probably good to update to the latest 16.x versions anyway.
New Behavior
Dependency updates and hoisting
Update to latest 16.x versions of:
react
16.14.0react-dom
16.14.0@types/react
16.14.23@types/react-dom
16.9.14react-test-renderer
16.14.0@types/react-test-renderer
16.9.5To avoid mismatches or dupes, this also required updates of:
csstype
to^3.0.2
in northstarscheduler
: this is a dep of React and is used as a dep of react-context-selector and react-bindings. Per discussion with Shift I moved this to a peer dep and allowed versions corresponding to either React 16 or 17.Where any of these packages are used as
devDependencies
, hoist them to the root.I also went ahead and hoisted
enzyme
,@types/enzyme
,enzyme-adapter-react-16
, and@types/enzyme-adapter-react-16
since this PR is already modifying the whole world and those deps are usually right next to the React ones indevDependencies
lists. (The pinned versions are the same versions that were already being installed by the~
or^
.)Other changes required by dependency updates
The typing and behavior updates in the latest React 16.x necessitated a few other changes:
UNSAFE_
prefix to remaining deprecated React lifecycles that didn't have it (e.g.componentWillReceiveProps
) to address new warningcsstype
/** @jsxRuntime classic */
to a few files that had/** @jsx withSlots */
but didn't specify ajsxRuntime
(addressing a new compiler error or warning IIRC)eslint-disable
s for newly-deprecatedReact.KeyboardEvent
propertiesuseTimeout
tests to account for React internals callingsetTimeout
BaseSelectedItem
to reflectReact.Attributes
type updates