Skip to content

fix: support @knighted/jsx type-only imports in DOM mode. - #39

Merged
knightedcodemonkey merged 1 commit into
mainfrom
bananas
Mar 28, 2026
Merged

fix: support @knighted/jsx type-only imports in DOM mode.#39
knightedcodemonkey merged 1 commit into
mainfrom
bananas

Conversation

@knightedcodemonkey

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 28, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the DOM render/typecheck pipeline to handle import type from @knighted/jsx without causing either TypeScript “module not found” diagnostics or runtime export {} syntax errors when code is executed via new Function(...).

Changes:

  • Add an ambient declare module '@knighted/jsx' to the DOM-mode JSX type stubs so type-only imports resolve during diagnostics.
  • Sanitize transpiled runtime code by stripping empty export {} statements before executing it in the Function-based runtime.
  • Add Playwright coverage for both DOM-mode rendering and DOM-mode typechecking with @knighted/jsx type-only imports.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/modules/type-diagnostics.js Adds an ambient @knighted/jsx module declaration and wires JSX.Element / children typing through it for DOM-mode diagnostics.
src/modules/render-runtime.js Strips empty export {} statements from transpiled code to avoid Function-runtime syntax errors.
playwright/rendering-modes.spec.ts Adds a DOM-mode runtime regression test for import type (ensures no preview error output + content renders).
playwright/diagnostics.spec.ts Adds a DOM-mode typecheck regression test ensuring @knighted/jsx type-only imports resolve cleanly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@knightedcodemonkey
knightedcodemonkey merged commit 0cc37a4 into main Mar 28, 2026
5 checks passed
@knightedcodemonkey
knightedcodemonkey deleted the bananas branch March 28, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants