chore(status-light): refactor with abstracted base class #5652
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR refactors the
sp-status-light
component to separate its base logic from rendering code, following the technical specifications for the Swan migration preparation. This is a purely internal change with no customer impact.Changes Made
File Structure Changes
packages/status-light/src/StatusLight.base.ts
as the base class forStatus light
component.Code Separation
StatusLightBase (Abstract Base Class)
packages/status-light/src/StatusLight.base.ts
StatusLight (Concrete Class)
packages/status-light/src/StatusLight.ts
render()
method)Impact
Customer Impact
Developer Impact
import { StatusLight } from '@spectrum-web-components/status-light'
still worksRelated issue(s)
Screenshots (if appropriate)
Author's checklist
I have added automated tests to cover my changes.(N/A)I have included a well-written changeset if my change needs to be published.(N/A)I have included updated documentation if my change required it.(N/A)Reviewer's checklist
Includes thoughtfully written changeset if changes suggested include(N/A)patch
,minor
, ormajor
featuresAutomated tests cover all use cases and follow best practices for writing(N/A)Manual review test cases
Manual Testing
Automated Testing
Device review
Migration Preparation
This refactoring prepares the badge component for future migration to the Swan architecture by:
Related