Skip to content

Conversation

@jsantell
Copy link
Collaborator

@jsantell jsantell commented Oct 24, 2025

  • @commontools/html is now a valid jsx-runtime implementation, like preact
  • @commontools/html is set as the Deno workspace jsx runtime
    • The pattern runtime still uses a global h render function that can be aligned in the future.
    • No longer React-types in typechecks
  • Removed react/react-dom/@types providing the React jsx runtime
  • Hack to support serving iframe-bootstrap.js, which has runtime deps not in our workspace, by renaming the file extension to work around this upstream issue: deno compile should not surface graph errors for modules specified on --include denoland/deno#27505
    • Removes @babel/standalone, and enables the full removal of React deps

Summary by cubic

Migrated the workspace to use @commontools/html as a drop-in JSX runtime, replacing React and simplifying our build. This adds jsx-runtime/jsx-dev-runtime support and removes React/Babel dependencies.

  • New Features

    • Added @commontools/html jsx-runtime and jsx-dev-runtime (jsx, jsxs, jsxDEV, Fragment).
    • Configured Deno workspace for "jsx": "react-jsx" with jsxImportSource "@commontools/html".
    • Added tests covering both runtimes and fragment behavior.
    • Pattern runtime still uses a global h; we can align it later.
  • Dependencies

    • Removed react, react-dom, @types/react, and @babel/standalone.
    • Renamed iframe-bootstrap.js to iframe-bootstrap._js with a server-side mapping to work around deno#27505; clients continue requesting .js.

@jsantell jsantell force-pushed the jsx-runtime branch 2 times, most recently from 6e6db39 to 6728861 Compare October 24, 2025 19:41
* @commontools/html is now a valid jsx-runtime implementation, like
  preact
* @commontools/html is set as the Deno workspace jsx runtime
  * The pattern runtime still uses a global `h` render function that can
    be aligned in the future.
* Removed react/react-dom/@types providing the React jsx runtime
* Hack to support serving `iframe-bootstrap.js`, which has runtime deps
  not in our workspace, by renaming the file extension to work around
  this upstream issue: denoland/deno#27505
  * Removes @babel/standalone, and enables the full removal of React
    deps
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 11 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/html/src/jsx-runtime.ts">

<violation number="1" location="packages/html/src/jsx-runtime.ts:47">
The JSX runtime ignores the `_key` argument, so keyed JSX elements lose their keys when compiled with `jsx: &quot;react-jsx&quot;`. Without the key, list reconciliation and any component logic that depends on it will misbehave. Please merge `_key` back into the props before calling `h`.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

? children
: [children];

return h(type, restProps, ...childArray);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSX runtime ignores the _key argument, so keyed JSX elements lose their keys when compiled with jsx: "react-jsx". Without the key, list reconciliation and any component logic that depends on it will misbehave. Please merge _key back into the props before calling h.

Prompt for AI agents
Address the following comment on packages/html/src/jsx-runtime.ts at line 47:

<comment>The JSX runtime ignores the `_key` argument, so keyed JSX elements lose their keys when compiled with `jsx: &quot;react-jsx&quot;`. Without the key, list reconciliation and any component logic that depends on it will misbehave. Please merge `_key` back into the props before calling `h`.</comment>

<file context>
@@ -0,0 +1,72 @@
+    ? children
+    : [children];
+
+  return h(type, restProps, ...childArray);
+}
+
</file context>
Fix with Cubic

@jsantell jsantell merged commit b587a4a into main Oct 24, 2025
9 checks passed
@jsantell jsantell deleted the jsx-runtime branch October 24, 2025 20:19
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