docs: rename basic examples' filename and component tag name#3968
docs: rename basic examples' filename and component tag name#3968adrianschmidt-bot wants to merge 27 commits intoLundalogik:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRenames many example components and updates corresponding JSDoc tags, Stencil Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/components/banner/examples/banner-basic.tsx (1)
4-10:⚠️ Potential issue | 🔴 CriticalUpdate the host element type after renaming the component tag.
Line 10 uses the old generated type (
HTMLLimelExampleBannerElement), but the tag was changed on Line 4 tolimel-example-banner-basic. StencilJS generates the HTML element interface name from the component tag, so it must be updated to match.🔧 Proposed fix
- private host: HTMLLimelExampleBannerElement; + private host: HTMLLimelExampleBannerBasicElement;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/banner/examples/banner-basic.tsx` around lines 4 - 10, The host property type is still the old generated interface (HTMLLimelExampleBannerElement) after you renamed the component tag to 'limel-example-banner-basic'; update the `@Element`() private host declaration in the BannerExample class to use the new generated interface name that corresponds to the tag (e.g., HTMLLimelExampleBannerBasicElement) so the type matches the component tag.src/components/button-group/examples/button-group-basic.tsx (1)
36-49:⚠️ Potential issue | 🟠 MajorUse
<Host>instead of returning an array fromrender().This file returns a hardcoded JSX array, which violates the coding guidelines for StencilJS components. All
.tsxfiles must wrap multiple JSX elements in the<Host>element instead of an array literal.Proposed refactor
-import { Component, h, State } from '@stencil/core'; +import { Component, h, Host, State } from '@stencil/core'; ... public render() { - return [ - <limel-button-group - disabled={this.disabled} - onChange={this.handleChange} - value={this.buttons} - />, - <limel-example-controls> - <limel-switch - label="Disabled" - onChange={this.toggleEnabled} - value={this.disabled} - /> - </limel-example-controls>, - ]; + return ( + <Host> + <limel-button-group + disabled={this.disabled} + onChange={this.handleChange} + value={this.buttons} + /> + <limel-example-controls> + <limel-switch + label="Disabled" + onChange={this.toggleEnabled} + value={this.disabled} + /> + </limel-example-controls> + </Host> + ); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/button-group/examples/button-group-basic.tsx` around lines 36 - 49, The render method currently returns a JSX array; update it to return a single <Host> wrapper containing the <limel-button-group> and <limel-example-controls> elements instead of an array literal. Import Host from '@stencil/core' if not already, then replace the array return with a single JSX tree: <Host> ... </Host> containing the existing <limel-button-group disabled={this.disabled} onChange={this.handleChange} value={this.buttons} /> and the <limel-example-controls> block (with the <limel-switch label="Disabled" onChange={this.toggleEnabled} value={this.disabled} /> inside). Ensure no other JSX siblings are returned from render().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/components/banner/examples/banner-basic.tsx`:
- Around line 4-10: The host property type is still the old generated interface
(HTMLLimelExampleBannerElement) after you renamed the component tag to
'limel-example-banner-basic'; update the `@Element`() private host declaration in
the BannerExample class to use the new generated interface name that corresponds
to the tag (e.g., HTMLLimelExampleBannerBasicElement) so the type matches the
component tag.
In `@src/components/button-group/examples/button-group-basic.tsx`:
- Around line 36-49: The render method currently returns a JSX array; update it
to return a single <Host> wrapper containing the <limel-button-group> and
<limel-example-controls> elements instead of an array literal. Import Host from
'@stencil/core' if not already, then replace the array return with a single JSX
tree: <Host> ... </Host> containing the existing <limel-button-group
disabled={this.disabled} onChange={this.handleChange} value={this.buttons} />
and the <limel-example-controls> block (with the <limel-switch label="Disabled"
onChange={this.toggleEnabled} value={this.disabled} /> inside). Ensure no other
JSX siblings are returned from render().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a88f0d0f-79a7-4e8e-9a2e-60b527572c89
📒 Files selected for processing (63)
src/components/badge/badge.tsxsrc/components/badge/examples/badge-basic.scsssrc/components/badge/examples/badge-basic.tsxsrc/components/banner/banner.tsxsrc/components/banner/examples/banner-basic.scsssrc/components/banner/examples/banner-basic.tsxsrc/components/button-group/button-group.tsxsrc/components/button-group/examples/button-group-basic.tsxsrc/components/checkbox/checkbox.tsxsrc/components/checkbox/examples/checkbox-basic.scsssrc/components/checkbox/examples/checkbox-basic.tsxsrc/components/chip-set/chip-set.tsxsrc/components/chip-set/examples/chip-set-basic.tsxsrc/components/circular-progress/circular-progress.tsxsrc/components/circular-progress/examples/circular-progress-basic.scsssrc/components/circular-progress/examples/circular-progress-basic.tsxsrc/components/code-editor/code-editor.tsxsrc/components/code-editor/examples/code-editor-basic.scsssrc/components/code-editor/examples/code-editor-basic.tsxsrc/components/dialog/dialog.tsxsrc/components/dialog/examples/dialog-basic.tsxsrc/components/dynamic-label/dynamic-label.tsxsrc/components/dynamic-label/examples/dynamic-label-basic.tsxsrc/components/file-dropzone/examples/file-dropzone-basic.scsssrc/components/file-dropzone/examples/file-dropzone-basic.tsxsrc/components/file-dropzone/file-dropzone.tsxsrc/components/file-input/examples/file-input-basic.tsxsrc/components/file-input/file-input.tsxsrc/components/file/examples/file-basic.tsxsrc/components/file/file.tsxsrc/components/header/examples/header-basic.tsxsrc/components/header/header.tsxsrc/components/help/examples/help-basic.tsxsrc/components/help/help.tsxsrc/components/helper-line/examples/helper-line-basic.tsxsrc/components/helper-line/helper-line.tsxsrc/components/info-tile/examples/info-tile-basic.scsssrc/components/info-tile/examples/info-tile-basic.tsxsrc/components/info-tile/info-tile.tsxsrc/components/linear-progress/examples/linear-progress-basic.tsxsrc/components/linear-progress/linear-progress.tsxsrc/components/list/examples/list-basic.tsxsrc/components/list/list.tsxsrc/components/select/examples/select-basic.tsxsrc/components/select/select.tsxsrc/components/shortcut/examples/shortcut-basic.scsssrc/components/shortcut/examples/shortcut-basic.tsxsrc/components/shortcut/shortcut.tsxsrc/components/snackbar/examples/snackbar-basic.tsxsrc/components/snackbar/snackbar.tsxsrc/components/spinner/examples/spinner-basic.scsssrc/components/spinner/examples/spinner-basic.tsxsrc/components/spinner/spinner.tsxsrc/components/switch/examples/switch-basic.tsxsrc/components/switch/switch.tsxsrc/components/tab-bar/examples/tab-bar-basic.tsxsrc/components/tab-bar/tab-bar.tsxsrc/components/tab-panel/examples/tab-panel-basic.scsssrc/components/tab-panel/examples/tab-panel-basic.tsxsrc/components/tab-panel/tab-panel.tsxsrc/components/table/examples/table-basic.scsssrc/components/table/examples/table-basic.tsxsrc/components/table/table.tsx
|
Thanks for the review! Banner host type — Good catch! The Button-group array return — This is a pre-existing pattern in the file (not introduced by this rename PR), so I'll leave it as-is to keep the scope focused on the rename. It could be addressed separately. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Renames the first (basic) example files for 26 components to follow the
-basicsuffix convention.For each component:
badge.tsx→badge-basic.tsx)@Component({ tag: '...' })decorator to match@exampleComponentreference in the main component file:host()selectors in SCSS filesEach component is committed separately for easy review.
Components renamed: badge, banner, button-group, checkbox, chip-set, circular-progress, code-editor, dialog, dynamic-label, file-dropzone, file-input, file, header, help, helper-line, info-tile, linear-progress, list, select, shortcut, snackbar, spinner, switch, tab-bar, tab-panel, table
fix: #3961
Summary by CodeRabbit