@tsrx/solid 0.0.21 → 0.0.23
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 +2 -2
- package/src/transform.js +6 -13
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Solid compiler built on @tsrx/core",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.23",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"esrap": "^2.1.0",
|
|
24
24
|
"zimmerframe": "^1.1.2",
|
|
25
|
-
"@tsrx/core": "0.0.
|
|
25
|
+
"@tsrx/core": "0.0.23"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"solid-js": ">=1.8 || >=2.0.0-beta"
|
package/src/transform.js
CHANGED
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
to_text_expression,
|
|
32
32
|
} from '@tsrx/core';
|
|
33
33
|
|
|
34
|
+
import { builders as b } from '@tsrx/core';
|
|
35
|
+
|
|
34
36
|
/**
|
|
35
37
|
* Solid extends the shared `JsxTransformContext` with `needs_*` flags that
|
|
36
38
|
* track which Solid runtime primitives (`Show`, `For`, `Switch`, `Match`,
|
|
@@ -1042,7 +1044,7 @@ function inject_solid_imports(program, transform_context) {
|
|
|
1042
1044
|
|
|
1043
1045
|
/**
|
|
1044
1046
|
* @param {any} node - walker-transformed Element whose `children` have
|
|
1045
|
-
* already had `
|
|
1047
|
+
* already had `Style` / `TSRXExpression` / nested `Element`
|
|
1046
1048
|
* walker rewrites applied.
|
|
1047
1049
|
* @param {TransformContext} transform_context
|
|
1048
1050
|
* @param {any[]} [pre_walk_children] - optional pre-walk children list
|
|
@@ -1051,9 +1053,7 @@ function inject_solid_imports(program, transform_context) {
|
|
|
1051
1053
|
* once detected we build the attribute from the original `Text.expression`.
|
|
1052
1054
|
* The factory's `Text` walker lowers `Text` → `JSXExpressionContainer`, so
|
|
1053
1055
|
* without these we'd miss the optimization. For rendering non-textContent
|
|
1054
|
-
* children we keep using `node.children` (walker-transformed)
|
|
1055
|
-
* `MemberExpression` rewrites on `StyleIdentifier` refs inside children
|
|
1056
|
-
* are preserved.
|
|
1056
|
+
* children we keep using `node.children` (walker-transformed).
|
|
1057
1057
|
* @returns {any}
|
|
1058
1058
|
*/
|
|
1059
1059
|
function to_jsx_element(node, transform_context, pre_walk_children) {
|
|
@@ -1152,19 +1152,12 @@ function to_jsx_element(node, transform_context, pre_walk_children) {
|
|
|
1152
1152
|
children = [];
|
|
1153
1153
|
selfClosing = true;
|
|
1154
1154
|
} else {
|
|
1155
|
-
// Use walker-transformed children
|
|
1156
|
-
// `StyleIdentifier` rewrites from the factory walker are preserved
|
|
1157
|
-
// in the emitted JSX.
|
|
1155
|
+
// Use walker-transformed children in the emitted JSX.
|
|
1158
1156
|
children = create_element_children(walked_children, transform_context);
|
|
1159
1157
|
}
|
|
1160
1158
|
|
|
1161
1159
|
const openingElement = set_loc(
|
|
1162
|
-
|
|
1163
|
-
type: 'JSXOpeningElement',
|
|
1164
|
-
name,
|
|
1165
|
-
attributes,
|
|
1166
|
-
selfClosing,
|
|
1167
|
-
}),
|
|
1160
|
+
b.jsx_opening_element(name, attributes, selfClosing, node.openingElement?.typeArguments),
|
|
1168
1161
|
node.openingElement || node,
|
|
1169
1162
|
);
|
|
1170
1163
|
|