feat: add new attributes and descriptions for RN environment components - #113
Conversation
📝 WalkthroughWalkthroughThis PR expands the React Native native component type definitions and documentation. It adds a shared ChangesRN Native Component Typings and Metadata
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Poem A rabbit hops through props galore, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (2)
packages/language-core/src/codegen/globalTypes/nativeComponentsTypes_refer.ts (2)
354-360: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winMirrors the
bindselectionchangevsbind:selectionchangemismatch flagged innativeComponentsTypes.ts.Same concern as
nativeComponentsTypes.ts— this file'sbindselectionchange(lines 360, 454) does not match thebind:selectionchangenaming used intemplate.ts.Also applies to: 448-454
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/language-core/src/codegen/globalTypes/nativeComponentsTypes_refer.ts` around lines 354 - 360, The native component event typings in nativeComponentsTypes_refer.ts use bindselectionchange, which is inconsistent with the bind:selectionchange naming used by template.ts and the related nativeComponentsTypes.ts entry. Update the affected type definitions in the corresponding native component interfaces so the event name matches the template syntax consistently wherever bindselectionchange appears, using the same symbol group that defines the input-related event props.
195-202: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winMirrors the
disableGesturecasing inconsistency flagged innativeComponentsTypes.ts.Same issue as
nativeComponentsTypes.tsline 195 —disableGesture(line 200) should be kebab-case ('disable-gesture') to be consistent with sibling attributes and correctly handled by theKubab2Camelmapping.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/language-core/src/codegen/globalTypes/nativeComponentsTypes_refer.ts` around lines 195 - 202, The native component props type still uses camelCase for the gesture toggle, which is inconsistent with the other attribute names and won’t map correctly through Kubab2Camel. Update the prop definition in nativeComponentsTypes_refer.ts within the native components type block to use the kebab-case key alongside the existing attributes, and keep the matching handling aligned with the same shape used in nativeComponentsTypes.ts and related type codegen helpers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/language-core/src/codegen/globalTypes/nativeComponentsTypes.ts`:
- Around line 349-355: The `bindselectionchange` event name is inconsistent
between `nativeComponentsTypes.ts` and `template.ts`; make both use the same
naming convention. Update the `MpxInput` and `MpxTextarea` event
declaration/docs so the autocomplete metadata and type definitions agree, and
keep the event name aligned with the existing no-colon `bind*` pattern used for
the other handlers.
- Around line 190-197: The native component attribute for disableGesture is
inconsistent with the kebab-case convention used by the generated types, so
update the generated declarations to use the kebab-case form and keep
Kubab2Camel-based consumption consistent. Change the disableGesture property in
nativeComponentsTypes.ts to the kebab-case attribute name, then update the
matching template.ts entry for disableGesture and the
nativeComponentsTypes_refer.ts reference so all three symbols stay aligned.
In `@packages/language-service/src/data/template.ts`:
- Around line 1822-1829: The event name entries for selection change are
inconsistent with the underlying native component property names and the rest of
this template file. Update both `bind:selectionchange` definitions in
`template.ts` to use the no-colon form that matches `MpxInput`/`MpxTextarea`
(`bindselectionchange`), keeping the existing descriptions unchanged so editor
suggestions align with the interface declarations and other event entries.
- Around line 622-659: The template autocomplete metadata for the swiper prop is
using camelCase for the `disableGesture` entry, which is inconsistent with the
other kebab-case attributes. Update the `template.ts` entry under the
swiper-related descriptions to use `disable-gesture`, and make the same casing
change in the corresponding `MpxSwiper` type definitions in
`nativeComponentsTypes.ts` and `nativeComponentsTypes_refer.ts` so autocomplete
and types stay aligned.
---
Duplicate comments:
In
`@packages/language-core/src/codegen/globalTypes/nativeComponentsTypes_refer.ts`:
- Around line 354-360: The native component event typings in
nativeComponentsTypes_refer.ts use bindselectionchange, which is inconsistent
with the bind:selectionchange naming used by template.ts and the related
nativeComponentsTypes.ts entry. Update the affected type definitions in the
corresponding native component interfaces so the event name matches the template
syntax consistently wherever bindselectionchange appears, using the same symbol
group that defines the input-related event props.
- Around line 195-202: The native component props type still uses camelCase for
the gesture toggle, which is inconsistent with the other attribute names and
won’t map correctly through Kubab2Camel. Update the prop definition in
nativeComponentsTypes_refer.ts within the native components type block to use
the kebab-case key alongside the existing attributes, and keep the matching
handling aligned with the same shape used in nativeComponentsTypes.ts and
related type codegen helpers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 38593323-c855-41b8-abc6-ddce167b6fe7
📒 Files selected for processing (3)
packages/language-core/src/codegen/globalTypes/nativeComponentsTypes.tspackages/language-core/src/codegen/globalTypes/nativeComponentsTypes_refer.tspackages/language-service/src/data/template.ts
Summary by CodeRabbit
New Features
Bug Fixes
Chores