Skip to content

Commit f06247f

Browse files
committed
Add JSX dev runtime
1 parent 001ed11 commit f06247f

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

lib/runtime-html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import {runtime} from './runtime.js'
33
import {h} from './html.js'
44

55
export * from './jsx-automatic.js'
6-
export const {Fragment, jsx, jsxs} = runtime(h)
6+
export const {Fragment, jsx, jsxs, jsxDEV} = runtime(h)

lib/runtime-svg.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import {runtime} from './runtime.js'
33
import {s} from './svg.js'
44

55
export * from './jsx-automatic.js'
6-
export const {Fragment, jsx, jsxs} = runtime(s)
6+
export const {Fragment, jsx, jsxs, jsxDEV} = runtime(s)

lib/runtime.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ export function runtime(f) {
3636
}
3737
)
3838

39-
return {Fragment: null, jsx, jsxs: jsx}
39+
return {Fragment: null, jsx, jsxs: jsx, jsxDEV: jsx}
4040
}

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@
3737
"./html.js": "./html.js",
3838
"./svg.js": "./svg.js",
3939
"./jsx-runtime": "./jsx-runtime.js",
40+
"./jsx-dev-runtime": "./jsx-runtime.js",
4041
"./html/jsx-runtime": "./html/jsx-runtime.js",
41-
"./svg/jsx-runtime": "./svg/jsx-runtime.js"
42+
"./html/jsx-dev-runtime": "./html/jsx-runtime.js",
43+
"./svg/jsx-runtime": "./svg/jsx-runtime.js",
44+
"./svg/jsx-dev-runtime": "./svg/jsx-runtime.js"
4245
},
4346
"files": [
4447
"lib/",

test/core.js

+12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ test('api', () => {
2525
)
2626
assert(jsxCore.includes('jsx'), 'should expose `jsx` from `/jsx-runtime`')
2727
assert(jsxCore.includes('jsxs'), 'should expose `jsxs` from `/jsx-runtime`')
28+
assert(
29+
jsxCore.includes('jsxDEV'),
30+
'should expose `jsxDEV` from `/jsx-runtime`'
31+
)
2832
const jsxHtml = Object.keys(jsxHtmlMod)
2933
assert(
3034
jsxHtml.includes('Fragment'),
@@ -38,6 +42,10 @@ test('api', () => {
3842
jsxHtml.includes('jsxs'),
3943
'should expose `jsxs` from `/html/jsx-runtime`'
4044
)
45+
assert(
46+
jsxHtml.includes('jsxDEV'),
47+
'should expose `jsxDEV` from `/html/jsx-runtime`'
48+
)
4149
const jsxSvg = Object.keys(jsxSvgMod)
4250
assert(
4351
jsxSvg.includes('Fragment'),
@@ -48,6 +56,10 @@ test('api', () => {
4856
jsxSvg.includes('jsxs'),
4957
'should expose `jsxs` from `/svg/jsx-runtime`'
5058
)
59+
assert(
60+
jsxSvg.includes('jsxDEV'),
61+
'should expose `jsxDEV` from `/svg/jsx-runtime`'
62+
)
5163
})
5264

5365
test('hastscript', async (t) => {

0 commit comments

Comments
 (0)