runtime-compiler 3.0.5 → 3.0.6
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/index.d.ts +6 -12
- package/index.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -10,13 +10,7 @@ export type Identifier<T> = Value<T> & {
|
|
|
10
10
|
export type ExportedDependency<T> = number & {
|
|
11
11
|
"~type": T
|
|
12
12
|
};
|
|
13
|
-
export
|
|
14
|
-
body: string;
|
|
15
|
-
/**
|
|
16
|
-
* Next available id.
|
|
17
|
-
*/
|
|
18
|
-
id: number;
|
|
19
|
-
}
|
|
13
|
+
export type Scope = [body: string, id: number];
|
|
20
14
|
/**
|
|
21
15
|
* Declare a variable in the current scope.
|
|
22
16
|
*/
|
|
@@ -33,17 +27,17 @@ export declare const declareLocal: (<T>(scope: Scope, expr: Expression<T>) => Id
|
|
|
33
27
|
* // let d0;{let d1=1;d0=d1}
|
|
34
28
|
* const id = exportLocal(childScope, declareLocal(childScope, '1'), parentScope); // d0
|
|
35
29
|
*/
|
|
36
|
-
export declare const exportLocal: (
|
|
30
|
+
export declare const exportLocal: (<T>(scope: Scope, expr: Expression<T>, parentScope: Scope) => Identifier<T>) | ((scope: Scope, expr: string, parentScope: Scope) => string);
|
|
37
31
|
/**
|
|
38
32
|
* External dependencies
|
|
39
33
|
*/
|
|
40
34
|
export declare const $: any[];
|
|
35
|
+
export declare let statements: string;
|
|
41
36
|
/**
|
|
42
|
-
* Export a local dependency.
|
|
37
|
+
* Export a local dependency of a scope.
|
|
43
38
|
* Use in `default` and `build` mode.
|
|
44
|
-
* @param value
|
|
45
39
|
*/
|
|
46
|
-
export declare const
|
|
40
|
+
export declare const exportScope: (<T>(scope: Scope, value: Expression<T>) => ExportedDependency<T>) | (<T>(scope: Scope, value: string) => ExportedDependency<T>);
|
|
47
41
|
/**
|
|
48
42
|
* Mark a slot to export a dependency.
|
|
49
43
|
* Use in `hydrate` mode.
|
|
@@ -62,4 +56,4 @@ export declare const injectExternal: <T>(val: T) => Value<T>;
|
|
|
62
56
|
* Run evaluated code.
|
|
63
57
|
* Use in `default` mode.
|
|
64
58
|
*/
|
|
65
|
-
export declare const evaluate: (
|
|
59
|
+
export declare const evaluate: () => void;
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export let declareLocal=(e,
|
|
1
|
+
export let declareLocal=(e,o)=>(e[0]+=`let d`+e[1]+`=`+o+`;`,`d`+ e[1]++);export let exportLocal=(e,o,s)=>{let c=`d`+ s[1]++;s[0]+=`let `+c+`;{`+e[0]+c+`=`+o+`}`;return c};export let $=[];export let statements=``;export let exportScope=(e,o)=>(statements+=`{`+e[0]+`$[`+$.length+`]=`+o+`}`,$.length++);export let markExported=()=>$.length++;export let getDependency=e=>$[e];export let injectExternal=e=>`$[`+($.push(e)-1)+`]`;export let evaluate=()=>{globalThis.__rt_externals__=$;(0,eval)(`{let $=__rt_externals__;`+statements+`}`)};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"runtime-compiler","version":"3.0.
|
|
1
|
+
{"name":"runtime-compiler","version":"3.0.6","description":"Universal compiler system","keywords":[],"repository":{},"homepage":"","license":"MIT","type":"module","exports":{"./utils":"./utils.js","./config":"./config/index.js","./config/loader/build":"./config/loader/build.js","./config/loader/hydrate":"./config/loader/hydrate.js","./config/mode/hydrate":"./config/mode/hydrate.js",".":"./index.js","./config/mode/build":"./config/mode/build.js"}}
|