@knighted/jsx 1.2.0-rc.5 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,8 +107,7 @@ export default {
|
|
|
107
107
|
{
|
|
108
108
|
loader: '@knighted/jsx/loader',
|
|
109
109
|
options: {
|
|
110
|
-
//
|
|
111
|
-
// tag: 'jsx', // single-tag option
|
|
110
|
+
// Optional: restrict or rename the tagged templates.
|
|
112
111
|
// tags: ['jsx', 'reactJsx'],
|
|
113
112
|
},
|
|
114
113
|
},
|
|
@@ -119,7 +118,7 @@ export default {
|
|
|
119
118
|
}
|
|
120
119
|
```
|
|
121
120
|
|
|
122
|
-
Pair the loader with your existing TypeScript/JSX transpiler (SWC, Babel, Rspack’s builtin loader, etc.) so regular React components and the tagged templates can live side by side. The demo fixture under `test/fixtures/rspack-app` shows a full setup that mixes Lit and React:
|
|
121
|
+
Pair the loader with your existing TypeScript/JSX transpiler (SWC, Babel, Rspack’s builtin loader, etc.) so regular React components and the tagged templates can live side by side. The demo fixture under `test/fixtures/rspack-app` shows a full setup that mixes Lit and React, and there is also a standalone walkthrough at [morganney/jsx-loader-demo](https://github.com/morganney/jsx-loader-demo):
|
|
123
122
|
|
|
124
123
|
```sh
|
|
125
124
|
npm run build
|
|
@@ -136,6 +135,8 @@ npx http-server test/fixtures/rspack-app -p 4173
|
|
|
136
135
|
|
|
137
136
|
Visit `http://localhost:4173` (or whichever port you pick) to interact with both the Lit + React hybrid demo and the React-mode bundle.
|
|
138
137
|
|
|
138
|
+
Need a deeper dive into loader behavior and options? Check out [`src/loader/README.md`](src/loader/README.md) for a full walkthrough.
|
|
139
|
+
|
|
139
140
|
## Node / SSR usage
|
|
140
141
|
|
|
141
142
|
Import the dedicated Node entry (`@knighted/jsx/node`) when you want to run the template tag inside bare Node.js. It automatically bootstraps a DOM shim by loading either `linkedom` or `jsdom` (install one of them to opt in) and then re-exports the usual helpers so you can keep authoring JSX in the same way:
|
|
@@ -348,7 +349,7 @@ npm run test:e2e
|
|
|
348
349
|
```
|
|
349
350
|
|
|
350
351
|
> [!NOTE]
|
|
351
|
-
> The e2e script builds the library, installs the WASM parser binding, bundles the loader fixture, and then runs `playwright test`. Make sure Playwright browsers are installed locally (`npx playwright install`).
|
|
352
|
+
> The e2e script builds the library, installs the WASM parser binding, bundles the loader fixture, and then runs `playwright test`. Make sure Playwright browsers are installed locally (`npx playwright install --with-deps chromium`).
|
|
352
353
|
|
|
353
354
|
## Browser demo / Vite build
|
|
354
355
|
|