-
Notifications
You must be signed in to change notification settings - Fork 10
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
WB-1634: Add supported themes list to wb-theming #2098
Conversation
🦋 Changeset detectedLatest commit: c2b94bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
Size Change: +379 B (0%) Total Size: 91.8 kB
ℹ️ View Unchanged
|
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (f9de0da) and published all packages with changesets to npm. You can install the packages in webapp by running: ./services/static/dev/tools/deploy_wonder_blocks.js --tag="PR2098" Packages can also be installed manually by running: yarn add @khanacademy/wonder-blocks-<package-name>@PR2098 |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2098 +/- ##
==========================================
+ Coverage 97.01% 97.03% +0.01%
==========================================
Files 240 242 +2
Lines 27534 27700 +166
Branches 2415 2345 -70
==========================================
+ Hits 26713 26879 +166
Misses 821 821
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-xiygwundau.chromatic.com/ Chromatic results:
|
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.
Nice!
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.
🎉
@@ -1,3 +1,6 @@ | |||
import {StyleDeclaration} from "aphrodite"; | |||
|
|||
export type ThemedStylesFn<T> = (theme: T) => StyleDeclaration; | |||
|
|||
export type SupportedThemes = "default" | "khanmigo"; | |||
export type Themes<T> = Partial<Record<SupportedThemes, T>>; |
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.
question: Is T
here an object? I wonder if we need to be specific about that with T extends Object
?
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.
nice catch! I'll add that, and yes, it expects an object.
@@ -1,3 +1,6 @@ | |||
import {StyleDeclaration} from "aphrodite"; | |||
|
|||
export type ThemedStylesFn<T> = (theme: T) => StyleDeclaration; |
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.
question: Does T
need to be constrained here to object or something?
Summary:
Exports supported themes list to enforce available themes.
This change will allow us to enforce that all themes are supported by the theme
switcher. This will prevent us from accidentally shipping a theme that is not
allowed.
Issue: https://khanacademy.atlassian.net/browse/WB-1634
Test plan:
Verify that the new types are exported and that the theme switcher context
enforces the supported themes list.