-
Notifications
You must be signed in to change notification settings - Fork 0
chore: align reactJsx types with react instrinsics. #63
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
=======================================
Coverage 88.81% 88.81%
=======================================
Files 23 23
Lines 1707 1707
Branches 460 460
=======================================
Hits 1516 1516
Misses 54 54
Partials 137 137 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 aligns the reactJsx helper's TypeScript types with React's intrinsic element typings. It adds new type exports that re-use React's type definitions for intrinsic elements, refs, events, and DOM attributes, making the API more consistent with React's JSX types while maintaining backward compatibility.
Changes:
- Adds comprehensive type-level test suite to ensure reactJsx types stay aligned with React intrinsics
- Exports seven helper types from
@knighted/jsx/reactfor users who need explicit type annotations - Updates documentation to clarify that reactJsx uses React's type definitions
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/react-jsx.types.test-d.ts | New type-only test file that validates type alignment with React's JSX intrinsics using compile-time assertions |
| src/react/react-jsx.ts | Adds new type imports from React and exports helper types that wrap React's intrinsic element types |
| src/react/index.ts | Re-exports the new helper types to make them available from @knighted/jsx/react |
| package.json | Version bump from 1.7.1 to 1.7.2 |
| package-lock.json | Corresponding lockfile update for version 1.7.2 |
| docs/typescript.md | Documents that reactJsx re-uses React's intrinsic element typings and mentions helper type exports |
| docs/runtime-helpers-overview.md | Adds note about intrinsic props, events, and refs following React's typings |
| README.md | Documents the new helper types and their availability |
| CHANGELOG.md | Documents the typing improvements in the unreleased section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.