@@ -43,7 +43,7 @@ If you have code, use something like [SWC][] or [esbuild][] instead.
43
43
## Install
44
44
45
45
This package is [ ESM only] [ esm ] .
46
- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
46
+ In Node.js (version 16 +), install with [ npm] [ ] :
47
47
48
48
``` sh
49
49
npm install estree-util-build-jsx
@@ -91,10 +91,10 @@ console.log(
91
91
92
92
``` js
93
93
import fs from ' node:fs/promises'
94
+ import jsx from ' acorn-jsx'
94
95
import {fromJs } from ' esast-util-from-js'
95
96
import {buildJsx } from ' estree-util-build-jsx'
96
97
import {toJs } from ' estree-util-to-js'
97
- import jsx from ' acorn-jsx'
98
98
99
99
const doc = String (await fs .readFile (' example.jsx' ))
100
100
@@ -123,7 +123,7 @@ console.log(x(null, null, 1 + 1, x("self-closing"), x("x", Object.assign({
123
123
124
124
## API
125
125
126
- This package exports the identifier [ ` buildJsx ` ] [ build-jsx ] .
126
+ This package exports the identifier [ ` buildJsx ` ] [ api- build-jsx] .
127
127
There is no default export.
128
128
129
129
### ` buildJsx(tree[, options]) `
@@ -147,7 +147,7 @@ Some differences:
147
147
148
148
* ` tree ` ([ ` Node ` ] [ node ] )
149
149
— tree to transform (typically [ ` Program ` ] [ program ] )
150
- * ` options ` ([ ` Options ` ] [ options ] , optional)
150
+ * ` options ` ([ ` Options ` ] [ api- options] , optional)
151
151
— configuration
152
152
153
153
###### Returns
@@ -165,7 +165,7 @@ Configuration (TypeScript type).
165
165
166
166
###### ` runtime `
167
167
168
- Choose the [ runtime] [ jsx-runtime ] ([ ` Runtime ` ] [ runtime ] , default: ` 'classic' ` ).
168
+ Choose the [ runtime] [ jsx-runtime ] ([ ` Runtime ` ] [ api- runtime] , default: ` 'classic' ` ).
169
169
170
170
Comment form: ` @jsxRuntime theRuntime ` .
171
171
@@ -249,14 +249,18 @@ tree.comments = comments
249
249
## Types
250
250
251
251
This package is fully typed with [TypeScript][].
252
- It exports the additional type [` Options` ][options] and [` Runtime` ][runtime].
252
+ It exports the additional type [` Options` ][api-options] and
253
+ [` Runtime` ][api-runtime].
253
254
254
255
## Compatibility
255
256
256
- Projects maintained by the unified collective are compatible with all maintained
257
+ Projects maintained by the unified collective are compatible with maintained
257
258
versions of Node.js.
258
- As of now, that is Node.js 14.14+ and 16.0+.
259
- Our projects sometimes work with older versions, but this is not guaranteed.
259
+
260
+ When we cut a new major release, we drop support for unmaintained versions of
261
+ Node.
262
+ This means we try to keep the current release line, ` estree- util- build- jsx@^ 2 ` ,
263
+ compatible with Node.js 12.
260
264
261
265
## Related
262
266
@@ -298,9 +302,9 @@ abide by its terms.
298
302
299
303
[downloads]: https://www.npmjs.com/package/estree-util-build-jsx
300
304
301
- [size-badge]: https://img.shields.io/bundlephobia/minzip/ estree-util-build-jsx.svg
305
+ [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= estree-util-build-jsx
302
306
303
- [size]: https://bundlephobia .com/result?p =estree-util-build-jsx
307
+ [size]: https://bundlejs .com/?q =estree-util-build-jsx
304
308
305
309
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
306
310
@@ -346,8 +350,8 @@ abide by its terms.
346
350
347
351
[esbuild]: https://esbuild.github.io
348
352
349
- [build-jsx]: #buildjsxtree-options
353
+ [api- build-jsx]: #buildjsxtree-options
350
354
351
- [options]: #options
355
+ [api- options]: #options
352
356
353
- [runtime]: #runtime-1
357
+ [api- runtime]: #runtime-1
0 commit comments