-
Notifications
You must be signed in to change notification settings - Fork 39
feat(atomic): migrate atomic-timeframe to Lit #6793
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
Conversation
Co-authored-by: fbeaudoincoveo <[email protected]>
Co-authored-by: fbeaudoincoveo <[email protected]>
Co-authored-by: fbeaudoincoveo <[email protected]>
Co-authored-by: fbeaudoincoveo <[email protected]>
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.ts
Show resolved
Hide resolved
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.ts
Show resolved
Hide resolved
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.ts
Outdated
Show resolved
Hide resolved
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.ts
Show resolved
Hide resolved
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.spec.ts
Show resolved
Hide resolved
- Delete original Stencil atomic-timeframe.tsx file - Add LitElementWithError implementation with error state property - Add constructor with Bueno schema validation (as private static readonly) - Pass false to ValidatePropsController to only log validation errors - Flatten nested describe blocks in tests per testing conventions - Add skipped validation tests with KIT-5197 TODOs Co-authored-by: fbeaudoincoveo <[email protected]>
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.
Pull request overview
This PR successfully migrates atomic-timeframe from Stencil to Lit as part of the framework modernization effort. The component is a light DOM data container that defines timeframe configurations for timeframe facet components. The migration follows established patterns for Lit components while preserving all functionality and adding comprehensive tests and documentation.
Key Changes
- Component rewrite: Complete conversion from Stencil
.tsxto Lit.tsusingLightDomMixin(LitElement)with property decorators and Bueno validation - Test suite addition: New comprehensive unit test suite with 17 active tests covering property validation, attribute reflection, and error handling
- Storybook enhancement: Updated stories with MSW mocking for realistic facet integration examples, plus comprehensive MDX documentation
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.tsx |
Deleted original Stencil component implementation |
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.ts |
New Lit implementation with property validation using ValidatePropsController |
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.spec.ts |
New comprehensive unit test suite with property, validation, and attribute reflection tests |
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.new.stories.tsx |
Enhanced stories with MSW mocking and multiple story variants (past/next periods, custom labels) |
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.mdx |
New documentation with usage examples and related component links |
packages/atomic/src/components/common/index.ts |
Added export for Lit component |
packages/atomic/src/components/common/lazy-index.ts |
Added lazy loading entry for component |
packages/atomic/src/utils/custom-element-tags.ts |
Registered component tag in custom element set |
packages/atomic/src/components.d.ts |
Removed Stencil-generated type definitions (now handled by Lit) |
packages/atomic-react/src/components/search/components.ts |
Added React wrapper for search interfaces |
packages/atomic-react/src/components/commerce/components.ts |
Added React wrapper for commerce interfaces |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/atomic/src/components/common/atomic-timeframe/atomic-timeframe.spec.ts
Outdated
Show resolved
Hide resolved
β¦ value Apply bot suggestion to create element with period='past' directly rather than modifying post-render, following the established pattern of creating elements with desired props. Co-authored-by: fbeaudoincoveo <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: fbeaudoincoveo <[email protected]> Co-authored-by: Frederic Beaudoin <[email protected]> Co-authored-by: developer-experience-bot[bot] <91079284+developer-experience-bot[bot]@users.noreply.github.com>
β Checklist
.mdxfileindex.tsandlazy-index.tsfiles.https://coveord.atlassian.net/browse/KIT-5321
Description
Migrates
atomic-timeframefrom Stencil to Lit as part of the framework modernization effort. This is a light DOM data container component with no rendering logic or controller integration.Changes Made
Component Migration
LightDomMixin(LitElement)with@propertydecoratorsTimeframeinterface andLitElementWithErrorperiod,unit,amount,label(all reflected to attributes)atomic-timeframe.tsxTesting
it.eachandit.skip.eachpatterns from atomic-result-list.spec.tsDocumentation
Exports
index.tsandlazy-index.tsfor Lit component loadingUsage
Notes
This component is a data container with no rendering logic or controller integration. E2E testing is handled through parent facet components (
atomic-timeframe-facet, etc.). No component-specific Cypress tests exist for this component.Original prompt
π¬ We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.