Skip to content

Semantic-tokens: Flat export deprecated tokens (Tree shakability in ESBuild) - #34235

Merged
Mitch-At-Work merged 6 commits into
microsoft:extended-tokensfrom
Mitch-At-Work:user/mifraser/add-legacy-script
Apr 14, 2025
Merged

Semantic-tokens: Flat export deprecated tokens (Tree shakability in ESBuild)#34235
Mitch-At-Work merged 6 commits into
microsoft:extended-tokensfrom
Mitch-At-Work:user/mifraser/add-legacy-script

Conversation

@Mitch-At-Work

Copy link
Copy Markdown
Contributor

Previous Behavior

Currently, webpack tree shakes fluentui/tokens package, however, ESBuild does not.

New Behavior

By flat exporting the deprecated fallback tokens, we ensure that any direct imports of fluentui/semantic-tokens will be tree shaken by default in all build systems.

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@Mitch-At-Work
Mitch-At-Work marked this pull request as ready for review April 11, 2025 20:28
@Mitch-At-Work
Mitch-At-Work requested a review from a team as a code owner April 11, 2025 20:28
@Mitch-At-Work
Mitch-At-Work force-pushed the user/mifraser/add-legacy-script branch from 783d7b5 to e082fc0 Compare April 14, 2025 16:30
Comment thread packages/semantic-tokens/etc/semantic-tokens.api.md
Comment thread packages/semantic-tokens/package.json
Comment thread packages/semantic-tokens/scripts/legacyTokens.ts Outdated

@brandonthomas brandonthomas left a comment

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.

I think we need to update the legacyTokens.ts script to ensure if the values of the tokens change we account for that vs assuming the delcaration name and value always match.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants