runtime-compiler 3.1.6 → 3.1.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/index.d.ts +16 -12
- package/index.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -12,24 +12,20 @@ export type ExportedDependency<T> = number & {
|
|
|
12
12
|
};
|
|
13
13
|
export interface Scope {
|
|
14
14
|
/**
|
|
15
|
-
* Current scope content
|
|
15
|
+
* Current scope content.
|
|
16
16
|
*/
|
|
17
17
|
0: string;
|
|
18
18
|
/**
|
|
19
19
|
* Next available id.
|
|
20
20
|
*/
|
|
21
21
|
1: number;
|
|
22
|
+
/**
|
|
23
|
+
* End scope content.
|
|
24
|
+
*/
|
|
25
|
+
2: string;
|
|
22
26
|
slice: () => this;
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
<T>(scope: Scope, expr: Expression<T>): Identifier<T>;
|
|
26
|
-
(scope: Scope, expr: string): string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Declare a variable in the current scope.
|
|
30
|
-
* Use in `default` and `build` mode.
|
|
31
|
-
*/
|
|
32
|
-
export declare const declareLocal: DeclareLocal;
|
|
28
|
+
export declare const nextId: <T>(scope: Scope) => Identifier<T>;
|
|
33
29
|
interface ExportLocal {
|
|
34
30
|
<T>(scope: Scope, expr: Expression<T>, parentScope: Scope): Identifier<T>;
|
|
35
31
|
(scope: Scope, expr: string, parentScope: Scope): string;
|
|
@@ -56,16 +52,24 @@ export declare const markDeclared: (scope: Scope) => void;
|
|
|
56
52
|
*/
|
|
57
53
|
export declare const $: any[];
|
|
58
54
|
export declare let statements: string;
|
|
55
|
+
interface ExportScope {
|
|
56
|
+
<T>(scope: Scope, value: Expression<T>): ExportedDependency<T>;
|
|
57
|
+
<T>(scope: Scope, value: string): ExportedDependency<T>;
|
|
58
|
+
}
|
|
59
59
|
/**
|
|
60
60
|
* Export a local dependency of a scope.
|
|
61
61
|
* Use in `default` and `build` mode.
|
|
62
62
|
*/
|
|
63
|
-
export declare const exportScope:
|
|
63
|
+
export declare const exportScope: ExportScope;
|
|
64
|
+
interface ExportExpr {
|
|
65
|
+
<T>(value: Expression<T>): ExportedDependency<T>;
|
|
66
|
+
<T>(value: string): ExportedDependency<T>;
|
|
67
|
+
}
|
|
64
68
|
/**
|
|
65
69
|
* Export a local expression.
|
|
66
70
|
* Use in `default` and `build` mode.
|
|
67
71
|
*/
|
|
68
|
-
export declare const exportExpr:
|
|
72
|
+
export declare const exportExpr: ExportExpr;
|
|
69
73
|
/**
|
|
70
74
|
* Mark a slot to export a dependency.
|
|
71
75
|
* Use in `hydrate` mode.
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isHydrating}from"./config/index.js";;export let
|
|
1
|
+
import{isHydrating}from"./config/index.js";;export let nextId=e=>`d`+ e[1]++;export let exportLocal=(e,f,p)=>{let m=`d`+ p[1]++;p[0]+=`let `+m+`;{`+e[0]+e[2]+m+`=`+f+`}`;return m};export let markDeclared=e=>{e[1]++};export let $=[];export let statements=``;export let exportScope=(e,f)=>(statements+=`{`+e[0]+e[2]+`$[`+$.length+`]=`+f+`}`,$.length++);export let exportExpr=e=>(statements+=`$[`+$.length+`]=`+e+`;`,$.length++);export let markExported=()=>$.length++;export let getDependency=e=>{if(statements.length>0){globalThis.__rt_externals__=$;(0,eval)(`{let $=__rt_externals__;`+statements+`}`);globalThis.__rt_externals__=null;statements=``;buildData=[]}return $[e]};export let getStatements=()=>{let e=statements;statements=``;buildData=[];return e};export let injectExternal=isHydrating?e=>($.push(e),``):e=>`$[`+($.push(e)-1)+`]`;export let buildData=[];let nextSlot=0;export let createBuildSlot=()=>nextSlot++;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"runtime-compiler","version":"3.1.
|
|
1
|
+
{"name":"runtime-compiler","version":"3.1.8","description":"Universal compiler system","keywords":[],"repository":{},"homepage":"","license":"MIT","type":"module","exports":{".":"./index.js","./utils":"./utils.js","./config":"./config/index.js","./config/loader/hydrate":"./config/loader/hydrate.js","./config/mode/build":"./config/mode/build.js","./config/mode/hydrate":"./config/mode/hydrate.js","./config/loader/build":"./config/loader/build.js"}}
|