-
Notifications
You must be signed in to change notification settings - Fork 163
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
Memoize theme creation for iOS, macOS, android #2485
Conversation
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.
Looks good to me, I'd make sure that fluent tester still responds to light/dark OS changes properly if you haven't. Or High Contrast
Ooh thanks for bringing that up, I checked that iOS light/dark mode still looks right to me (looked at the shadows test page) - but actually think macOS might not work since that method doesn't have the appearance as a parameter to the method. If a memoized method doesn't take in any arguments then I think it will only ever be created once? Checking macOS now |
Double checked and confirmed that switching appearances in macOS is broken with this change, going to mark as a draft until I come up with a fix. Thinking I'll move the existing calls to getting the appearance up the call stack so that we pass the appearance through the method parameters. Also this seems like something the PR checks should be able to catch, will also look into add more dark mode tests or maybe make a work item for this |
Oh yeah, we set up the macOS theme (and others) to call |
|
For 2, 4, and 5 above will follow up in a later PR |
Platforms Impacted
Description of changes
There was a suggestion in PR #2483 to memoize the method creating the default theme to prevent the method from creating a new theme object every time it's called. This PR is just making the same change for the iOS, macOS, and android themes.
Verification
CI/automated tests should pass. No visual changes.
Pull request checklist
This PR has considered (when applicable):