Fix project-wide JSX type errors#88
Conversation
Adds a global JSX namespace definition to types/perry/ui/index.d.ts. This resolves project-wide TypeScript errors where tsc reports that 'JSX' has no exported member 'Element' when using .tsx files. - Maps JSX.Element to the Widget type. - Adds IntrinsicElements catch-all for flexible tag names. - Adds IntrinsicAttributes and IntrinsicClassAttributes for standard props. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
I have fixed the project-wide JSX type errors by adding a global
JSXnamespace definition totypes/perry/ui/index.d.ts.When developers use
.tsxfiles with the Perry compiler,tscexpects a globalJSX.Elementtype to be defined. Since Perry's native type stubs lacked this definition,tscwould report errors even if the build (using esbuild) succeeded.The fix:
types/perry/ui/index.d.ts: Added adeclare globalblock containing theJSXnamespace.JSX.ElementtoWidget: This tells TypeScript that JSX expressions evaluate to Perry's native widget handles.IntrinsicElements: Added a string indexer to allow any tag name, which is necessary for Perry's component model where constructors like<VStack>are used directly.IntrinsicAttributesandIntrinsicClassAttributesto support standard props likekeyandref.I verified the fix by creating a test
.tsxfile and runningtscwith a configuration that uses the modified Perry types. All JSX-related namespace errors were resolved. I also ran existingperry-hirtests to ensure no regressions in the compiler's lowering logic.PR created automatically by Jules for task 15557381483055699204 started by @yumin-chen