@tsrx/react 0.2.25 → 0.2.26
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/package.json +3 -4
- package/src/index.js +0 -1
- package/src/transform.js +4 -0
- package/src/dynamic.js +0 -9
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React compiler built on @tsrx/core",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.26",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
"default": "./src/error-boundary.js"
|
|
24
24
|
},
|
|
25
25
|
"./dynamic": {
|
|
26
|
-
"types": "./types/dynamic.d.ts"
|
|
27
|
-
"default": "./src/dynamic.js"
|
|
26
|
+
"types": "./types/dynamic.d.ts"
|
|
28
27
|
},
|
|
29
28
|
"./ref": {
|
|
30
29
|
"types": "./types/ref.d.ts",
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"esrap": "^2.2.8",
|
|
40
39
|
"zimmerframe": "^1.1.2",
|
|
41
|
-
"@tsrx/core": "0.1.
|
|
40
|
+
"@tsrx/core": "0.1.26"
|
|
42
41
|
},
|
|
43
42
|
"peerDependencies": {
|
|
44
43
|
"react": ">=18"
|
package/src/index.js
CHANGED
package/src/transform.js
CHANGED
|
@@ -16,6 +16,10 @@ const react_platform = {
|
|
|
16
16
|
fragment: 'react',
|
|
17
17
|
suspense: 'react',
|
|
18
18
|
dynamic: '@tsrx/react/dynamic',
|
|
19
|
+
// Production output aliases dynamic tags to a scoped component const
|
|
20
|
+
// inside an expression-child IIFE, re-evaluated on every render; the
|
|
21
|
+
// type-only transform keeps the `Dynamic` component shape (types only).
|
|
22
|
+
dynamicFactory: {},
|
|
19
23
|
errorBoundary: '@tsrx/react/error-boundary',
|
|
20
24
|
mergeRefs: '@tsrx/react/ref',
|
|
21
25
|
refProp: '@tsrx/react/ref',
|
package/src/dynamic.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createElement } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @param {{ is: import('react').ElementType | null | undefined | false, [key: string]: any }} props
|
|
5
|
-
* @returns {import('react').ReactElement | null}
|
|
6
|
-
*/
|
|
7
|
-
export function Dynamic({ is, ...props }) {
|
|
8
|
-
return is ? createElement(is, props) : null;
|
|
9
|
-
}
|