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: use yarn policies to enforce same yarn version on ci and local #17196
chore: use yarn policies to enforce same yarn version on ci and local #17196
Conversation
|
Why can't just pin the yarn version instead of adding binaries into the repo ? |
To enforce same version being used everywhere. I hope the image and both commit and PR description are self explanatory. |
|
This is an interesting idea, but have you seen any problems related to different yarn versions in practice? It's not something I can remember running into. |
|
Another option if you want to ensure CI uses a specific yarn version is that the yarn installer task accepts specific versions. (Also practically speaking, given that yarn is actively resisting changes to v1 at this point, new 1.x releases and especially breaking changes are not very likely.) |
yup, lock files output differed all the time, for same install ofc (which was quite stable for the last changes). Still having same version everywhere tends to be a common best practice in the long run (same for node etc) |
the goal is to have same version on both ci/local environment |
So you're seeing lock file output variation even when dependencies haven't been modified? |
Completely agree with this, but I don't think commiting |
But then, without something like |
it is common, and automatically done by yarn https://classic.yarnpkg.com/en/docs/cli/policies/ I co-authored an article about it as well https://medium.com/productboard-engineering/one-yarn-to-rule-them-all-2d950127ee6f |
|
|
thats good to hear, time to reboot this PR :) |
e00b474
to
430565d
2baafc0
to
b52e551
|
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 1c362a3:
|
|
| Package & Exports | Size (minified/GZIP) |
|---|---|
| react-accordion Accordion (including children components) |
54.888 kB17.524 kB |
| react-avatar Avatar |
44.266 kB12.603 kB |
| react-badge Badge |
24.19 kB7.107 kB |
| react-badge CounterBadge |
25.058 kB7.407 kB |
| react-badge PresenceBadge |
22.507 kB6.587 kB |
| react-button Button |
28.197 kB8.093 kB |
| react-button CompoundButton |
33.494 kB9.054 kB |
| react-button MenuButton |
30.118 kB8.728 kB |
| react-button SplitButton |
36.193 kB9.798 kB |
| react-button ToggleButton |
37.434 kB8.689 kB |
| react-card Card - All |
48.488 kB14.347 kB |
| react-card Card |
43.997 kB13.195 kB |
| react-card CardFooter |
7.618 kB3.232 kB |
| react-card CardHeader |
8.885 kB3.673 kB |
| react-card CardPreview |
7.811 kB3.361 kB |
| react-components react-components: Accordion, Button, FluentProvider, Image, Menu, Popover |
166.089 kB47.059 kB |
| react-components react-components: FluentProvider & webLightTheme |
32.489 kB10.636 kB |
| react-divider Divider |
15.269 kB5.523 kB |
| react-image Image |
10.075 kB3.942 kB |
| react-input Input |
21.474 kB7.118 kB |
| react-label Label |
8.323 kB3.479 kB |
| react-link Link |
11.072 kB4.496 kB |
| react-make-styles makeStaticStyles (runtime) |
8.161 kB3.564 kB |
| react-make-styles makeStyles + mergeClasses (runtime) |
19.554 kB7.446 kB |
| react-make-styles makeStyles + mergeClasses (build time) |
2.793 kB1.267 kB |
| react-menu Menu (including children components) |
103.149 kB31.833 kB |
| react-menu Menu (including selectable components) |
105.4 kB32.191 kB |
| react-popover Popover |
95.348 kB29.017 kB |
| react-portal Portal |
6.249 kB2.163 kB |
| react-positioning usePopper |
22.808 kB7.935 kB |
| react-provider FluentProvider |
13.972 kB5.237 kB |
| react-slider Slider |
22.936 kB7.751 kB |
| react-spinner Spinner |
6.787 kB2.887 kB |
| react-switch Switch |
25.397 kB8.208 kB |
| react-text Text - Default |
10.769 kB4.224 kB |
| react-text Text - Wrappers |
14.077 kB4.565 kB |
| react-theme Single theme token import |
69 B89 B |
| react-theme Teams: all themes |
29.426 kB6.551 kB |
| react-theme Teams: Light theme |
18.42 kB5.27 kB |
| react-tooltip Tooltip |
44.872 kB15.617 kB |
| react-utilities SSRProvider |
189 B161 B |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: bc7772a8f45b02b95dc527a6e7af2ee2651a474f (build) |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 832 | 838 | 5000 | |
| BaseButton | mount | 827 | 805 | 5000 | |
| Breadcrumb | mount | 2305 | 2297 | 1000 | |
| ButtonNext | mount | 440 | 449 | 5000 | |
| Checkbox | mount | 1363 | 1340 | 5000 | |
| CheckboxBase | mount | 1149 | 1152 | 5000 | |
| ChoiceGroup | mount | 4104 | 4101 | 5000 | |
| ComboBox | mount | 862 | 863 | 1000 | |
| CommandBar | mount | 8932 | 9047 | 1000 | |
| ContextualMenu | mount | 7387 | 7408 | 1000 | |
| DefaultButton | mount | 1000 | 989 | 5000 | |
| DetailsRow | mount | 3266 | 3266 | 5000 | |
| DetailsRowFast | mount | 3427 | 3271 | 5000 | |
| DetailsRowNoStyles | mount | 3108 | 3080 | 5000 | |
| Dialog | mount | 2194 | 2287 | 1000 | |
| DocumentCardTitle | mount | 169 | 163 | 1000 | |
| Dropdown | mount | 2726 | 2579 | 5000 | |
| FluentProviderNext | mount | 1746 | 1717 | 5000 | |
| FluentProviderWithTheme | mount | 147 | 160 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 104 | 108 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 187 | 186 | 10 | |
| FocusTrapZone | mount | 1631 | 1623 | 5000 | |
| FocusZone | mount | 1607 | 1577 | 5000 | |
| IconButton | mount | 1493 | 1509 | 5000 | |
| Label | mount | 322 | 321 | 5000 | |
| Layer | mount | 2389 | 2585 | 5000 | |
| Link | mount | 435 | 419 | 5000 | |
| MakeStyles | mount | 1446 | 1471 | 50000 | |
| MenuButton | mount | 1300 | 1259 | 5000 | |
| MessageBar | mount | 1693 | 1690 | 5000 | |
| Nav | mount | 2879 | 2862 | 1000 | |
| OverflowSet | mount | 965 | 997 | 5000 | |
| Panel | mount | 2232 | 2207 | 1000 | |
| Persona | mount | 739 | 802 | 1000 | |
| Pivot | mount | 1243 | 1261 | 1000 | |
| PrimaryButton | mount | 1178 | 1142 | 5000 | |
| Rating | mount | 6653 | 6665 | 5000 | |
| SearchBox | mount | 1172 | 1190 | 5000 | |
| Shimmer | mount | 2195 | 2282 | 5000 | |
| Slider | mount | 1722 | 1739 | 5000 | |
| SpinButton | mount | 4533 | 4326 | 5000 | |
| Spinner | mount | 404 | 398 | 5000 | |
| SplitButton | mount | 2784 | 2785 | 5000 | |
| Stack | mount | 486 | 481 | 5000 | |
| StackWithIntrinsicChildren | mount | 2033 | 2018 | 5000 | |
| StackWithTextChildren | mount | 4536 | 4542 | 5000 | |
| SwatchColorPicker | mount | 9982 | 9768 | 5000 | |
| TagPicker | mount | 2274 | 2330 | 5000 | |
| TeachingBubble | mount | 11412 | 11430 | 5000 | |
| Text | mount | 397 | 403 | 5000 | |
| TextField | mount | 1226 | 1202 | 5000 | |
| ThemeProvider | mount | 1050 | 1038 | 5000 | |
| ThemeProvider | virtual-rerender | 546 | 540 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 1658 | 1613 | 5000 | |
| Toggle | mount | 728 | 707 | 5000 | |
| buttonNative | mount | 140 | 146 | 5000 |
Perf Analysis (@fluentui/react-northstar)
Perf tests with no regressions
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| GridMinimalPerf.default | 907 | 300 | 3.02:1 |
| CustomToolbarPrototype.default | 4453 | 3546 | 1.26:1 |
| PortalMinimalPerf.default | 167 | 151 | 1.11:1 |
| AttachmentMinimalPerf.default | 138 | 125 | 1.1:1 |
| ChatDuplicateMessagesPerf.default | 278 | 254 | 1.09:1 |
| DatepickerMinimalPerf.default | 5350 | 4911 | 1.09:1 |
| SkeletonMinimalPerf.default | 325 | 298 | 1.09:1 |
| TreeMinimalPerf.default | 707 | 667 | 1.06:1 |
| TreeWith60ListItems.default | 162 | 153 | 1.06:1 |
| BoxMinimalPerf.default | 314 | 298 | 1.05:1 |
| FlexMinimalPerf.default | 262 | 250 | 1.05:1 |
| ListWith60ListItems.default | 565 | 542 | 1.04:1 |
| ReactionMinimalPerf.default | 333 | 321 | 1.04:1 |
| AlertMinimalPerf.default | 239 | 232 | 1.03:1 |
| MenuMinimalPerf.default | 725 | 702 | 1.03:1 |
| ProviderMinimalPerf.default | 991 | 966 | 1.03:1 |
| RadioGroupMinimalPerf.default | 399 | 387 | 1.03:1 |
| SegmentMinimalPerf.default | 300 | 291 | 1.03:1 |
| StatusMinimalPerf.default | 595 | 576 | 1.03:1 |
| IconMinimalPerf.default | 520 | 505 | 1.03:1 |
| TextMinimalPerf.default | 310 | 301 | 1.03:1 |
| TextAreaMinimalPerf.default | 432 | 418 | 1.03:1 |
| AnimationMinimalPerf.default | 472 | 463 | 1.02:1 |
| AttachmentSlotsPerf.default | 911 | 891 | 1.02:1 |
| ButtonMinimalPerf.default | 154 | 151 | 1.02:1 |
| ButtonSlotsPerf.default | 468 | 457 | 1.02:1 |
| HeaderSlotsPerf.default | 653 | 641 | 1.02:1 |
| ImageMinimalPerf.default | 330 | 323 | 1.02:1 |
| TableMinimalPerf.default | 358 | 350 | 1.02:1 |
| CardMinimalPerf.default | 477 | 474 | 1.01:1 |
| CarouselMinimalPerf.default | 413 | 409 | 1.01:1 |
| DropdownManyItemsPerf.default | 581 | 576 | 1.01:1 |
| EmbedMinimalPerf.default | 3518 | 3495 | 1.01:1 |
| FormMinimalPerf.default | 348 | 343 | 1.01:1 |
| InputMinimalPerf.default | 1107 | 1096 | 1.01:1 |
| ItemLayoutMinimalPerf.default | 1014 | 1001 | 1.01:1 |
| ListMinimalPerf.default | 444 | 438 | 1.01:1 |
| MenuButtonMinimalPerf.default | 1416 | 1406 | 1.01:1 |
| ProviderMergeThemesPerf.default | 1473 | 1460 | 1.01:1 |
| TableManyItemsPerf.default | 1593 | 1585 | 1.01:1 |
| ToolbarMinimalPerf.default | 815 | 803 | 1.01:1 |
| TooltipMinimalPerf.default | 880 | 871 | 1.01:1 |
| ButtonOverridesMissPerf.default | 1460 | 1453 | 1:1 |
| ChatMinimalPerf.default | 645 | 642 | 1:1 |
| ChatWithPopoverPerf.default | 335 | 335 | 1:1 |
| DropdownMinimalPerf.default | 2575 | 2570 | 1:1 |
| LayoutMinimalPerf.default | 307 | 306 | 1:1 |
| SplitButtonMinimalPerf.default | 3658 | 3643 | 1:1 |
| CheckboxMinimalPerf.default | 2245 | 2267 | 0.99:1 |
| HeaderMinimalPerf.default | 322 | 326 | 0.99:1 |
| LabelMinimalPerf.default | 330 | 333 | 0.99:1 |
| RefMinimalPerf.default | 204 | 207 | 0.99:1 |
| AccordionMinimalPerf.default | 137 | 140 | 0.98:1 |
| ListNestedPerf.default | 466 | 476 | 0.98:1 |
| LoaderMinimalPerf.default | 579 | 588 | 0.98:1 |
| ListCommonPerf.default | 532 | 549 | 0.97:1 |
| AvatarMinimalPerf.default | 164 | 170 | 0.96:1 |
| DividerMinimalPerf.default | 303 | 317 | 0.96:1 |
| DialogMinimalPerf.default | 649 | 685 | 0.95:1 |
| RosterPerf.default | 988 | 1045 | 0.95:1 |
| PopupMinimalPerf.default | 519 | 549 | 0.95:1 |
| VideoMinimalPerf.default | 518 | 545 | 0.95:1 |
| SliderMinimalPerf.default | 1405 | 1508 | 0.93:1 |
| versionSpec: 1.22.x | ||
| checkLatest: false | ||
| includePrerelease: false | ||
| - script: | |
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.
What's the reasoning for switching the approach here?
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.
- simplification
- not rely on 3rd party to do a fundamental operation like installing packages - in past we run into some outages which blocked all pipelines AFAIR
| # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
| # yarn lockfile v1 |
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.
Not super important but this doesn't look like a lockfile or autogenerated?
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 file was generated when running yarn policies set-version
|
Are all of the people on this thread mac users? |
No, but I use WSL unfortunately |
Just a reminder then to check any build related updates in mac/wsl, and windows |
Description of changes
Before:
1.
x)2. confusing pre and post install hooks DX
using npm install

using yarn

After:
1. same
yarnversion used everywhere, no matter what yarn@1 version/fork is installed on developer machine globallyCLI DEMO:
How it works:

2. improved pre and post install hooks DX
using npm i

using yarn

Perf on local machine -
yarn installThat's approx 63% speedup🔥
The text was updated successfully, but these errors were encountered: