-
Notifications
You must be signed in to change notification settings - Fork 208
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
chore: refactor sp-theme #4743
chore: refactor sp-theme #4743
Conversation
Pull Request Test Coverage Report for Build 10902516554Details
💛 - Coveralls |
8b4b023
to
7c0fd57
Compare
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
Tachometer resultsChromeaction-bar permalinkbasic-test
action-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
breadcrumbs permalinkbasic-test
combobox permalinkbasic-test
light-dom-test permalink
contextual-help permalinkbasic-test
menu permalinktest-basic
overlay permalinkbasic-test
directive-test permalink
element-test permalink
lazy-test permalink
picker permalinkbasic-test
popover permalinktest-basic
slider permalinktest-basic
split-button permalinkbasic-test
tooltip permalinktest-basic
test-directive permalink
test-element permalink
test-lazy permalink
truncated permalinkbasic-test
Firefoxaction-bar permalinkbasic-test
action-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
breadcrumbs permalinkbasic-test
combobox permalinkbasic-test
light-dom-test permalink
contextual-help permalinkbasic-test
menu permalinktest-basic
overlay permalinkbasic-test
directive-test permalink
element-test permalink
lazy-test permalink
picker permalinkbasic-test
popover permalinktest-basic
slider permalinktest-basic
split-button permalinkbasic-test
tooltip permalinktest-basic
test-directive permalink
test-element permalink
test-lazy permalink
truncated permalinkbasic-test
|
828abce
to
b68d601
Compare
tools/theme/src/Theme.ts
Outdated
'https://opensource.adobe.com/spectrum-web-components/tools/themes/#deprecation', | ||
{ level: 'deprecation' } | ||
); | ||
if (value === 'spectrum-two') { |
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.
This reads weird to me in that if you are on spectrum-two
you'd get two warnings, one saying deprecated and one saying beta? I guess that's only if they use the theme property though. Anyway, Beta
seems like a long term possibility so I wonder if it makes sense to just create a warnBetaSystem
which would make the call site clearer too.
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.
It does look to me like this would get called even if they used system
instead of theme
though, so probably worth breaking it a part? Or something?
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.
Oops, you are right. After moving this debugging code around it ended up becoming messy. I have now cleaned it up, so it now only warns once about the deprecated use of theme
.
Following your suggestion, I also created a dedicated beta warning (for S2) that we can remove if we want. Do we want to remove this beta warning? cc: @Rajdeepc
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.
Yes it make sense to remove the beta warning for now! We will add this step by step once we start rolling things for S2. Thanks for doing this! Appreciate it
tools/theme/src/Theme.ts
Outdated
{ level: 'deprecation' } | ||
); | ||
if (value === 'spectrum-two') { | ||
window.__swc.warn( |
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.
Do we need this warning now?
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.
I am not sure, maybe we remove on 1.0.0?
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.
Yes let's remove on 1.0.0? Maybe add this to the TODO list.
ce72753
to
b68d601
Compare
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.
good stuff!!!
4721f5c
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.
Let's land this!
Description
Removed unnecessary polyfills and refactored the
sp-theme
code.Related issue(s)
Motivation and context
Our
sp-theme
needs some love, we will probably build upon it to enable more complex functionality in our system (e.g., using context). So this is just a first step on cleaning it up a bit.How has this been tested?
Existing tests, as this is purely a refactor.
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.