You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,21 @@ transpileJsxSource(input, {
94
94
})
95
95
```
96
96
97
+
By default, TypeScript syntax is preserved in the output. If your source needs to run directly
98
+
as JavaScript (for example, code entered in an editor), enable type stripping:
99
+
100
+
```ts
101
+
transpileJsxSource(input, {
102
+
typescript: 'strip',
103
+
})
104
+
```
105
+
106
+
Supported `typescript` modes:
107
+
108
+
-`'preserve'` (default): keep TypeScript syntax in output.
109
+
-`'strip'`: remove type-only declarations and erase inline type syntax (`: T`, `as T`,
110
+
`satisfies T`, non-null assertions, and type assertions) while still transpiling JSX.
111
+
97
112
### React runtime (`reactJsx`)
98
113
99
114
Need to compose React elements instead of DOM nodes? Import the dedicated helper from the `@knighted/jsx/react` subpath (React 18+ and `react-dom` are still required to mount the tree):
Copy file name to clipboardExpand all lines: docs/next-steps.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,3 +6,4 @@ A few focused improvements will give @knighted/jsx a more polished, batteries-in
6
6
2.**Starter templates** – Ship StackBlitz/CodeSandbox starters (DOM-only, React, Lit + React) that highlight CDN flows and bundler builds. Link them in the README/docs so developers can experiment without cloning the repo.
7
7
3.**Diagnostics UX polish** – Build on the new `enableJsxDebugDiagnostics` helper by surfacing template codeframes, component names, and actionable remediation steps. Ship CLI toggles / README callouts so CDN demos and starters enable debug mode automatically in development while keeping production bundles pristine.
8
8
4.**Bundle-size trims** – With debug helpers moved to opt-in paths, refocus on analyzer-driven trims (property-information lookups, node bootstrap reuse, shared helper chunks). Validate the new floor across lite + standard builds with `npm run sizecheck` and document any remaining hotspots so future releases keep shrinking.
9
+
5.**TypeScript transform strategy** – Evaluate replacing (or augmenting) manual TS syntax erasure in `transpileJsxSource` with `oxc-transform` for `typescript: 'strip'` mode. Build a fixture matrix (annotations, interfaces/type aliases, `as`, `satisfies`, non-null assertions, generics) and compare output correctness, runtime behavior, and bundle impact before deciding whether to adopt `oxc-transform` as the default implementation.
0 commit comments