-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore(react-theme): Generate theme tokens using token pipeline #22457
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(react-theme): Generate theme tokens using token pipeline #22457
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 e86df5e:
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 924 | 865 | 5000 | |
| Button | mount | 530 | 594 | 5000 | |
| FluentProvider | mount | 1804 | 1807 | 5000 | |
| FluentProviderWithTheme | mount | 273 | 286 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 225 | 209 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 311 | 299 | 10 | |
| MakeStyles | mount | 1464 | 1526 | 50000 |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 65f94192ed3b2cde7e52b9c7e12d6f38b81965dd (build) |
Perf Analysis (
|
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| SegmentMinimalPerf.default | 865 | 273 | 3.17:1 |
| MenuButtonMinimalPerf.default | 1393 | 1287 | 1.08:1 |
| TableMinimalPerf.default | 345 | 323 | 1.07:1 |
| AvatarMinimalPerf.default | 168 | 158 | 1.06:1 |
| PortalMinimalPerf.default | 146 | 138 | 1.06:1 |
| BoxMinimalPerf.default | 290 | 276 | 1.05:1 |
| ButtonMinimalPerf.default | 141 | 134 | 1.05:1 |
| DropdownManyItemsPerf.default | 575 | 549 | 1.05:1 |
| GridMinimalPerf.default | 285 | 272 | 1.05:1 |
| HeaderSlotsPerf.default | 634 | 611 | 1.04:1 |
| ImageMinimalPerf.default | 302 | 291 | 1.04:1 |
| RosterPerf.default | 919 | 881 | 1.04:1 |
| RadioGroupMinimalPerf.default | 375 | 362 | 1.04:1 |
| RefMinimalPerf.default | 619 | 596 | 1.04:1 |
| TextMinimalPerf.default | 289 | 277 | 1.04:1 |
| TreeWith60ListItems.default | 145 | 140 | 1.04:1 |
| ButtonOverridesMissPerf.default | 1264 | 1223 | 1.03:1 |
| ChatDuplicateMessagesPerf.default | 251 | 244 | 1.03:1 |
| DialogMinimalPerf.default | 636 | 619 | 1.03:1 |
| DividerMinimalPerf.default | 304 | 294 | 1.03:1 |
| DropdownMinimalPerf.default | 2575 | 2506 | 1.03:1 |
| FormMinimalPerf.default | 346 | 336 | 1.03:1 |
| ListMinimalPerf.default | 436 | 423 | 1.03:1 |
| IconMinimalPerf.default | 515 | 501 | 1.03:1 |
| AccordionMinimalPerf.default | 111 | 109 | 1.02:1 |
| AttachmentMinimalPerf.default | 130 | 128 | 1.02:1 |
| AttachmentSlotsPerf.default | 927 | 913 | 1.02:1 |
| EmbedMinimalPerf.default | 3474 | 3407 | 1.02:1 |
| ItemLayoutMinimalPerf.default | 997 | 977 | 1.02:1 |
| ListWith60ListItems.default | 554 | 544 | 1.02:1 |
| PopupMinimalPerf.default | 534 | 523 | 1.02:1 |
| ProviderMinimalPerf.default | 340 | 334 | 1.02:1 |
| SplitButtonMinimalPerf.default | 3694 | 3629 | 1.02:1 |
| CardMinimalPerf.default | 464 | 461 | 1.01:1 |
| CarouselMinimalPerf.default | 399 | 397 | 1.01:1 |
| LabelMinimalPerf.default | 313 | 309 | 1.01:1 |
| LayoutMinimalPerf.default | 300 | 296 | 1.01:1 |
| ListCommonPerf.default | 542 | 535 | 1.01:1 |
| MenuMinimalPerf.default | 710 | 705 | 1.01:1 |
| ProviderMergeThemesPerf.default | 1065 | 1057 | 1.01:1 |
| SkeletonMinimalPerf.default | 873 | 865 | 1.01:1 |
| SliderMinimalPerf.default | 1425 | 1414 | 1.01:1 |
| StatusMinimalPerf.default | 557 | 553 | 1.01:1 |
| TableManyItemsPerf.default | 1611 | 1597 | 1.01:1 |
| TextAreaMinimalPerf.default | 406 | 402 | 1.01:1 |
| TooltipMinimalPerf.default | 912 | 901 | 1.01:1 |
| TreeMinimalPerf.default | 684 | 679 | 1.01:1 |
| AnimationMinimalPerf.default | 458 | 459 | 1:1 |
| ChatMinimalPerf.default | 607 | 610 | 1:1 |
| DatepickerMinimalPerf.default | 4954 | 4953 | 1:1 |
| ReactionMinimalPerf.default | 307 | 306 | 1:1 |
| CustomToolbarPrototype.default | 2320 | 2321 | 1:1 |
| ButtonSlotsPerf.default | 451 | 454 | 0.99:1 |
| ChatWithPopoverPerf.default | 319 | 323 | 0.99:1 |
| CheckboxMinimalPerf.default | 2226 | 2259 | 0.99:1 |
| FlexMinimalPerf.default | 238 | 240 | 0.99:1 |
| ToolbarMinimalPerf.default | 789 | 797 | 0.99:1 |
| VideoMinimalPerf.default | 542 | 550 | 0.99:1 |
| InputMinimalPerf.default | 1062 | 1091 | 0.97:1 |
| LoaderMinimalPerf.default | 547 | 566 | 0.97:1 |
| HeaderMinimalPerf.default | 265 | 297 | 0.89:1 |
| ListNestedPerf.default | 404 | 471 | 0.86:1 |
| AlertMinimalPerf.default | 198 | 681 | 0.29:1 |
📊 Bundle size reportUnchanged fixtures
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| BaseButton | mount | 774 | 798 | 5000 | |
| Breadcrumb | mount | 2370 | 2372 | 1000 | |
| Checkbox | mount | 1289 | 1268 | 5000 | |
| CheckboxBase | mount | 1081 | 1089 | 5000 | |
| ChoiceGroup | mount | 4097 | 4038 | 5000 | |
| ComboBox | mount | 869 | 839 | 1000 | |
| CommandBar | mount | 9135 | 9151 | 1000 | |
| ContextualMenu | mount | 9907 | 10033 | 1000 | |
| DefaultButton | mount | 969 | 973 | 5000 | |
| DetailsRow | mount | 3343 | 3280 | 5000 | |
| DetailsRowFast | mount | 3318 | 3370 | 5000 | |
| DetailsRowNoStyles | mount | 3152 | 3144 | 5000 | |
| Dialog | mount | 1960 | 1956 | 1000 | |
| DocumentCardTitle | mount | 145 | 151 | 1000 | |
| Dropdown | mount | 2855 | 2845 | 5000 | |
| FocusTrapZone | mount | 1626 | 1571 | 5000 | |
| FocusZone | mount | 1581 | 1581 | 5000 | |
| IconButton | mount | 1507 | 1539 | 5000 | |
| Label | mount | 303 | 305 | 5000 | |
| Layer | mount | 2544 | 2524 | 5000 | |
| Link | mount | 414 | 386 | 5000 | |
| MenuButton | mount | 1278 | 1266 | 5000 | |
| MessageBar | mount | 1843 | 1827 | 5000 | |
| Nav | mount | 2877 | 2836 | 1000 | |
| OverflowSet | mount | 953 | 929 | 5000 | |
| Panel | mount | 1844 | 1872 | 1000 | |
| Persona | mount | 860 | 861 | 1000 | |
| Pivot | mount | 1252 | 1266 | 1000 | |
| PrimaryButton | mount | 1130 | 1136 | 5000 | |
| Rating | mount | 6735 | 6720 | 5000 | |
| SearchBox | mount | 1122 | 1143 | 5000 | |
| Shimmer | mount | 2137 | 2172 | 5000 | |
| Slider | mount | 1691 | 1669 | 5000 | |
| SpinButton | mount | 4342 | 4344 | 5000 | |
| Spinner | mount | 389 | 372 | 5000 | |
| SplitButton | mount | 2749 | 2747 | 5000 | |
| Stack | mount | 443 | 458 | 5000 | |
| StackWithIntrinsicChildren | mount | 2004 | 2013 | 5000 | |
| StackWithTextChildren | mount | 4559 | 4555 | 5000 | |
| SwatchColorPicker | mount | 10133 | 10066 | 5000 | |
| TagPicker | mount | 2323 | 2371 | 5000 | |
| TeachingBubble | mount | 83779 | 83298 | 5000 | |
| Text | mount | 370 | 370 | 5000 | |
| TextField | mount | 1216 | 1239 | 5000 | |
| ThemeProvider | mount | 1012 | 1027 | 5000 | |
| ThemeProvider | virtual-rerender | 560 | 550 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 1630 | 1605 | 5000 | |
| Toggle | mount | 699 | 694 | 5000 | |
| buttonNative | mount | 117 | 124 | 5000 |
scripts/tasks/token-pipeline.ts
Outdated
| const tmpDir = createTempDir('theme'); | ||
|
|
||
| execSync('git clone https://github.com/microsoft/fluentui-design-tokens.git', 'Clone design tokens repo', tmpDir); | ||
| execSync('npm install', 'Install dependencies', path.join(tmpDir, 'fluentui-design-tokens')); |
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.
they do use npm ? asking because if we invoked this via yarn it would be significantly faster
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.
on the other hand, do we actually need to install anything ? we can run that tool directly via npx without any install
npx @fluentui/token-pipeline --in src/global.json --in src/${_.kebabCase(theme)}.json --out ${outDir}/${theme}
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.
Yes, npm.
The reason why I install before running the pipeline is to use the correct version of the @fluentui/token-pipeline. npx searches for the script in node_modules first -> correct version is used.
But running npx directly would install latest, correct?
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.
^ correct. we can always do the trick we do within our github actions to fetch the version used, but at this stage I think that would be way too much overhead.
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 I'd like to see in general is if that the repo could provide apis being shipped to npm so we don't need to go through such a hassle on our side.
Hotell
left a comment
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.
🚀
apps/public-docsite-v9/src/Concepts/Upgrade/FromV8/Components/Input.stories.mdx
Show resolved
Hide resolved
…soft#22457) * chore(react-theme): Generate theme tokens using token pipeline * update type * Address PR comments * Do not register the script as just task * Update paths to reflect the new location of react-theme * Change file
Part of
react-themeis generated using token pipeline from microsoft/fluentui-design-tokens.This PR adds a script which runs the pipeline to update the generated files:
microsoft/fluentui-design-tokensrepo,npm installto install dependencies,react-themeThe script is currently not executed automatically anywhere.