Skip to content

Semantic-tokens: Add initial package - #34121

Merged
Mitch-At-Work merged 4 commits into
microsoft:extended-tokensfrom
Mitch-At-Work:user/mifraser/add-semantic-tokens-package
Apr 3, 2025
Merged

Semantic-tokens: Add initial package#34121
Mitch-At-Work merged 4 commits into
microsoft:extended-tokensfrom
Mitch-At-Work:user/mifraser/add-semantic-tokens-package

Conversation

@Mitch-At-Work

Copy link
Copy Markdown
Contributor

Adding initial project skeleton for the semantic-tokens package.

See full implementation here: #33971

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

Comment thread packages/semantic-tokens/package.json Outdated
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/scripts-api-extractor": "*",
"@fluentui/tokens": ">=1.0.0-alpha",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@brandonthomas

Copy link
Copy Markdown
Contributor

Adding Victor Genaev (@mainframev) and Dmytro Kirpa (@dmytrokirpa) per Tudor Popa (@tudorpopams) and I's conversation that they should also check this out.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks overall good to me, but I will let v-build to check the scripts part.

@Mitch-At-Work
Mitch-At-Work merged commit 1469b4a into microsoft:extended-tokens Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants