Semantic-tokens: Add initial package - #34121
Conversation
|
Pull request demo site: URL |
| "devDependencies": { | ||
| "@fluentui/eslint-plugin": "*", | ||
| "@fluentui/scripts-api-extractor": "*", | ||
| "@fluentui/tokens": ">=1.0.0-alpha", |
There was a problem hiding this comment.
We use tokens as a devDep as they are imported via the script for backwards compatible overrides.
We can optimize this further by only exporting the variables listed in fluentOverrides.ts file, however for now we simply export all tokens to a flat export in a singular legacy file for tree shaking.
There was a problem hiding this comment.
We should definitely write up some kind of plan, and think through any cons to the approach of flat re-exporting those tokens. If it's something we should do in the tokens package itself or just scope the flat export via script to this package only. etc.
There was a problem hiding this comment.
Since we aim to supersede the existing token set, I think keeping it within our semantic-tokens package makes sense, I've now defaulted it to only export the tokens that are actively used as fallbacks so we can reduce bundle size prior to tree shaking also.
If we choose, we can now also remove the devdep on fluentui/tokens package, however we do use it as a safety mechanism to ensure that the tokens being used as fallbacks exist.
|
Adding Victor Genaev (@mainframev) and Dmytro Kirpa (@dmytrokirpa) per Tudor Popa (@tudorpopams) and I's conversation that they should also check this out. |
Oleksandr Fediashov (layershifter)
left a comment
There was a problem hiding this comment.
This looks overall good to me, but I will let v-build to check the scripts part.
Adding initial project skeleton for the semantic-tokens package.
See full implementation here: #33971