@transclude/core 0.10.0 → 0.10.1
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 +1 -1
- package/src/compiler/shim.js +12 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transclude/core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "An HTML-first server framework. A page is an .html file, the directory tree is the route table, and any fragment of a page is a URL of its own. Runs on Node, Bun, Deno and workerd, and ships no client JavaScript by default.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"html",
|
package/src/compiler/shim.js
CHANGED
|
@@ -18,6 +18,7 @@ import { ambientJsdoc } from './ambient.js';
|
|
|
18
18
|
import { parseEach } from './directives.js';
|
|
19
19
|
import { childrenOf } from './codegen.js';
|
|
20
20
|
import { splitInterpolations } from './interp.js';
|
|
21
|
+
import { GLOBALS as EXPRESSION_GLOBALS } from './expr.js';
|
|
21
22
|
import { splitBlocks } from './index.js';
|
|
22
23
|
import { planLift } from './script.js';
|
|
23
24
|
import { ACTION_METHODS } from '../document.js';
|
|
@@ -700,10 +701,17 @@ function collectRoots(node, scope, out) {
|
|
|
700
701
|
}
|
|
701
702
|
}
|
|
702
703
|
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
704
|
+
/**
|
|
705
|
+
* The names an expression resolves without a data lookup, plus the three
|
|
706
|
+
* literals acorn hands back as identifiers where jsep does not.
|
|
707
|
+
*
|
|
708
|
+
* Taken from the expression layer rather than written out again. The two lists
|
|
709
|
+
* were separate and drifted: `json` was in one and not the other, so the
|
|
710
|
+
* documented helper compiled, rendered, and then failed `npm run check` saying
|
|
711
|
+
* it was not a field of the page's data. Anything the compiler resolves has to
|
|
712
|
+
* resolve here too, or the shim checks code the compiler never emits.
|
|
713
|
+
*/
|
|
714
|
+
const GLOBALS = new Set([...EXPRESSION_GLOBALS, 'true', 'false', 'null']);
|
|
707
715
|
|
|
708
716
|
function collectUsedTags(nodes, components, found = new Set()) {
|
|
709
717
|
for (const node of nodes) {
|