Skip to content

Conversation

@miroslavstastny
Copy link
Member

@miroslavstastny miroslavstastny commented Jun 14, 2022

This RFC proposes to reduce number of shared color alias tokens to improve performance.
Changing the tokens would be a BREAKING CHANGE!

PREVIEW

@fabricteam
Copy link
Collaborator

fabricteam commented Jun 14, 2022

📊 Bundle size report

🤖 This report was generated against d4db5211e7a53eaa7910b87f737bd959218a78e0

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 14, 2022

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 133c76a:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Jun 14, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: d4db5211e7a53eaa7910b87f737bd959218a78e0 (build)

- 👍 Reducing shared color alias tokens from 441 to ~225 instead of increasing them to ~600 (to add tokens needed for Calendar)
- 👍 More clarity around which specific color to use for semantic states instead of relying on design guidance
- 👍 Allows a bit more wiggle room for the semantic alias table to grow w/o adding too much bloat
- 👎 **Breaking change after the final RC**
Copy link
Contributor

Choose a reason for hiding this comment

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

For me this is the reason to not make this change, or rather, to make it in a non-breaking way.

As you note below this should not affect partners much but my experience with other breaking changes is that they can require quite a bit of coordination between partners. Historically we've reserved the right to make breaking changes to resolve accessibility issues and my belief is that performance is an accessibility issue but we should still strive to make these types of changes in a non-breaking way whenever possible.

While it is not ideal to ship a first release with deprecated features (in fact this was a motivation for breaking changes we've previously made during RC) my feeling is that we're getting too close to the stable release to ship a breaking change that isn't resolving a hard blocking issue. I don't feel this is a hard blocking issue for release as we can ship "v2" or "perf" versions of all themes and update our docs to demonstrate their use in all cases.

I do think this is a good change to make and I'm not strictly opposed to making it in a breaking way, I would just prefer to do so in a backwards compatible way given our release schedule.

Copy link
Member

Choose a reason for hiding this comment

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

I tend to agree with @spmonahan here, we should do this either in a non-breaking way or change our release schedule.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please prioritize actually asking partners about this? they stand the most to gain/lose for perf/breaking change in this scenario

Copy link
Contributor

@Hotell Hotell Jun 15, 2022

Choose a reason for hiding this comment

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

I do think this is a good change to make and I'm not strictly opposed to making it in a breaking way, I would just prefer to do so in a backwards compatible way given our release schedule.

we agreed that BC in RC phase can be done if really necessary, so landing this prior to stable should be ok.

Also dunno if you folks read reasoning regarding why v2 was discarded, but it gives you good additional context

Copy link
Collaborator

Choose a reason for hiding this comment

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

@spmonahan has been working most closely with partners on BC, so he should have a sense of their tolerance. That being said, I agree with @ling1726 that flighting this with our core partners is a the right call.

Copy link
Contributor

Choose a reason for hiding this comment

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

let me put on my partner hat. v9 adoption in Teams is currently blocked by the perf issue - injecting too many tokens delays initial render and degreades some of the perf metrics. I don't know if all partners track this metrics but probably the initial render is critical for most of them. In production rings this is up to 300ms regression in average and we have seen the cost being linear with relation to the amount of tokens.

Migration to new theme might have some cost for the partners and it will have cost for Teams, but as far as I undrstand it, it will be a change that breaks build and is easily detectable.

If we decide to deprecate the old theme, partners will need to migrate to the new theme anyway.

Since we are in RC, I think we should not release final version knowing that a change like this is planned. We should make the change and explain the benefits.

- 👍 Reducing shared color alias tokens from 441 to ~225 instead of increasing them to ~600 (to add tokens needed for Calendar)
- 👍 More clarity around which specific color to use for semantic states instead of relying on design guidance
- 👍 Allows a bit more wiggle room for the semantic alias table to grow w/o adding too much bloat
- 👎 **Breaking change after the final RC**
Copy link
Member

Choose a reason for hiding this comment

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

I tend to agree with @spmonahan here, we should do this either in a non-breaking way or change our release schedule.

Copy link
Contributor

@Hotell Hotell left a comment

Choose a reason for hiding this comment

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

approving in terms of technological solution to our design system, lets get alignment regarding the approach - BC / v2


The theme currently contains 49 global shared colors.

Current alias structure forces each ramp to be uniform (the same set of alias tokens for each shared color), resulting in 49 alias tokens each time we need a new line item (new alias token). Today we have 9 alias slots = total alias count is 441 (49x9).
Copy link
Contributor

Choose a reason for hiding this comment

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

q: can you pls elaborate what ramp means?

Copy link
Member Author

Choose a reason for hiding this comment

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

the same set of alias tokens for each shared color :-) I will try to describe it better.

- 👍 Reducing shared color alias tokens from 441 to ~225 instead of increasing them to ~600 (to add tokens needed for Calendar)
- 👍 More clarity around which specific color to use for semantic states instead of relying on design guidance
- 👍 Allows a bit more wiggle room for the semantic alias table to grow w/o adding too much bloat
- 👎 **Breaking change after the final RC**
Copy link
Contributor

@Hotell Hotell Jun 15, 2022

Choose a reason for hiding this comment

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

I do think this is a good change to make and I'm not strictly opposed to making it in a breaking way, I would just prefer to do so in a backwards compatible way given our release schedule.

we agreed that BC in RC phase can be done if really necessary, so landing this prior to stable should be ok.

Also dunno if you folks read reasoning regarding why v2 was discarded, but it gives you good additional context

miroslavstastny and others added 2 commits June 27, 2022 13:08
Co-authored-by: Makoto Morimoto <[email protected]>
Co-authored-by: Geoff Cox (Microsoft) <[email protected]>
@miroslavstastny miroslavstastny merged commit d5d510b into microsoft:master Jun 27, 2022
@miroslavstastny miroslavstastny deleted the rfc/reduce-shared-colors branch June 27, 2022 11:36
rohitpagariya pushed a commit to rohitpagariya/fluentui that referenced this pull request Jun 28, 2022
* RFC: Reduce number of shared color alias tokens

* Apply suggestions from code review

Co-authored-by: Makoto Morimoto <[email protected]>
Co-authored-by: Geoff Cox (Microsoft) <[email protected]>

* address PR comments

Co-authored-by: Makoto Morimoto <[email protected]>
Co-authored-by: Geoff Cox (Microsoft) <[email protected]>
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.

10 participants