@tsrx/solid 0.0.6 → 0.0.8
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 +7 -0
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.8",
|
|
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.8"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"solid-js": ">=1.8 || >=2.0.0-beta"
|
package/src/transform.js
CHANGED
|
@@ -1059,6 +1059,9 @@ function create_jsx_element(tag_name, attributes, children) {
|
|
|
1059
1059
|
};
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
1062
|
+
const TEMPLATE_FRAGMENT_ERROR =
|
|
1063
|
+
'JSX fragment syntax is not needed in TSRX templates. TSRX renders in immediate mode, so everything is already a fragment. Use `<>...</>` only within <tsx>...</tsx>.';
|
|
1064
|
+
|
|
1062
1065
|
/**
|
|
1063
1066
|
* Inject `import { Show, For, Switch, Match, Errored, Loading } from 'solid-js'`
|
|
1064
1067
|
* specifiers for whichever control-flow primitives the transform emitted.
|
|
@@ -1119,6 +1122,10 @@ function to_jsx_element(node, transform_context) {
|
|
|
1119
1122
|
);
|
|
1120
1123
|
}
|
|
1121
1124
|
|
|
1125
|
+
if (!node.id) {
|
|
1126
|
+
throw create_compile_error(node, TEMPLATE_FRAGMENT_ERROR);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1122
1129
|
if (is_dynamic_element_id(node.id)) {
|
|
1123
1130
|
return dynamic_element_to_jsx_child(node, transform_context);
|
|
1124
1131
|
}
|