Skip to content
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

Return default theme when unknown theme value is passed #1660

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

envex
Copy link
Collaborator

@envex envex commented Apr 16, 2024

What does this implement/fix?

Previously we threw an error when a theme could not be found, but that would cause the parent component to crash.

Now we'll return the default theme and warn in the console instead of an Error.

Resolves #1659

Storybook link

https://6062ad4a2d14cd0021539c1b-dhhtmrpotq.chromatic.com/?path=/story/polaris-viz-charts-barchart-chromatic--bad-theme

Before merging

  • Check your changes on a variety of browsers and devices.

  • Update the Changelog's Unreleased section with your changes.

  • Update relevant documentation, tests, and Storybook.

  • Make sure you're exporting any new shared Components, Types and Utilities from the top level index file of the package

Copy link

github-actions bot commented Apr 16, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
polaris-viz-core-cjs 61.3 KB (+0.07% 🔺) 1.3 s (+0.07% 🔺) 933 ms (-25.92% 🔽) 2.2 s
polaris-viz-cjs 216.09 KB (+0.02% 🔺) 4.4 s (+0.02% 🔺) 2 s (+6.93% 🔺) 6.3 s
polaris-viz-esm 176.39 KB (+0.02% 🔺) 3.6 s (+0.02% 🔺) 1.1 s (-15.39% 🔽) 4.6 s
polaris-viz-css 4.79 KB (0%) 96 ms (0%) 274 ms (-26.2% 🔽) 370 ms
polaris-viz-esnext 182.35 KB (+0.02% 🔺) 3.7 s (+0.02% 🔺) 1.5 s (-5.62% 🔽) 5.2 s

Copy link
Collaborator

@michaelnesen michaelnesen left a comment

Choose a reason for hiding this comment

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

Nice 🚀

@envex envex force-pushed the envex/default-theme-fallback branch from 79ef3df to b0a6493 Compare April 16, 2024 15:03
@envex envex force-pushed the envex/default-theme-fallback branch from b0a6493 to eef7a41 Compare April 16, 2024 16:53
@envex envex merged commit a169931 into main Apr 16, 2024
8 checks passed
@envex envex deleted the envex/default-theme-fallback branch April 16, 2024 18:37
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.

Properly fallback to available themes
2 participants