@torpor/view 0.4.0 → 0.4.2
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/CHANGELOG.md +12 -0
- package/dist/dev.cjs +1 -2
- package/dist/dev.cjs.map +1 -1
- package/dist/dev.d.cts.map +1 -1
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +1 -2
- package/dist/dev.js.map +1 -1
- package/dist/{devContext-nomc0xCl.cjs → devContext-B3yskfhA.cjs} +3 -3
- package/dist/devContext-B3yskfhA.cjs.map +1 -0
- package/dist/{devContext-CM-9Rx7k.js → devContext-CevrTlUO.js} +3 -3
- package/dist/devContext-CevrTlUO.js.map +1 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/dev/devContext.ts +22 -22
- package/src/dev/setDevMode.ts +0 -1
- package/src/render/context.ts +35 -30
- package/dist/devContext-CM-9Rx7k.js.map +0 -1
- package/dist/devContext-nomc0xCl.cjs.map +0 -1
package/src/render/context.ts
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
import type Context from "../types/Context";
|
|
2
|
+
import type Region from "../types/Region";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
previousEffect: null,
|
|
6
|
-
extent: 0,
|
|
7
|
-
batch: 0,
|
|
8
|
-
batchOperation: 0,
|
|
9
|
-
registerComputed: null,
|
|
4
|
+
// TODO: Possibly create this in mount/hydrate so we aren't always checking
|
|
5
|
+
// whether it exists with `??=`
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
firstSignalToUpdate: null,
|
|
7
|
+
const CONTEXT_SYMBOL: unique symbol = Symbol.for("t_context");
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
const context: Context =
|
|
15
10
|
// @ts-ignore
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
(globalThis[CONTEXT_SYMBOL] ??= {
|
|
12
|
+
activeTarget: null,
|
|
13
|
+
previousEffect: null,
|
|
14
|
+
extent: 0,
|
|
15
|
+
batch: 0,
|
|
16
|
+
batchOperation: 0,
|
|
17
|
+
registerComputed: null,
|
|
18
|
+
|
|
19
|
+
firstEffectToRun: null,
|
|
20
|
+
firstSignalToUpdate: null,
|
|
21
|
+
|
|
22
|
+
// These will definitely be set, in mount or render
|
|
23
|
+
activeRegion: null as unknown as Region,
|
|
24
|
+
previousRegion: null as unknown as Region,
|
|
25
|
+
rootRegion: null as unknown as Region,
|
|
26
|
+
|
|
27
|
+
mountEffects: [],
|
|
28
|
+
stashedEvents: [],
|
|
29
|
+
stashedAnimations: [],
|
|
30
|
+
|
|
31
|
+
hydrationNode: null,
|
|
32
|
+
//hn: null,
|
|
33
|
+
//get hydrationNode() {
|
|
34
|
+
// return this.hn;
|
|
35
|
+
//},
|
|
36
|
+
//set hydrationNode(value) {
|
|
37
|
+
// console.log(`set hydration ${printNode(value)}`);
|
|
38
|
+
// this.hn = value;
|
|
39
|
+
//},
|
|
40
|
+
} satisfies Context);
|
|
36
41
|
|
|
37
42
|
export default context;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devContext-CM-9Rx7k.js","names":["devContext: DevContext"],"sources":["../src/dev/devContext.ts"],"sourcesContent":["import type DevContext from \"./types/DevContext\";\n\nconst noop = () => {};\n\nconst devContext: DevContext = {\n\tenabled: false,\n\tdepth: 0,\n\tindex: -1,\n\tboundaries: [],\n\n\tformat: () => \"\",\n\tgetDetails: () => \"\",\n\tunmark: noop,\n\tmark: noop,\n\n\t// Hooks\n\tonWatch: noop,\n\tonRun: noop,\n\tonRegionPushed: noop,\n\tonRegionPopped: noop,\n\tonRegionCleared: noop,\n\n\tsignalSet: noop,\n\teffectRun: noop,\n};\n\n// Add to globalThis for getting from the extension\n// @ts-ignore\nglobalThis.T_DEV_CTX = devContext;\n\nexport default devContext;\n"],"mappings":";AAEA,MAAM,aAAa;AAEnB,MAAMA,aAAyB;CAC9B,SAAS;CACT,OAAO;CACP,OAAO;CACP,YAAY,EAAE;CAEd,cAAc;CACd,kBAAkB;CAClB,QAAQ;CACR,MAAM;CAGN,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB,gBAAgB;CAChB,iBAAiB;CAEjB,WAAW;CACX,WAAW;CACX;AAID,WAAW,YAAY;AAEvB,yBAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devContext-nomc0xCl.cjs","names":["devContext: DevContext"],"sources":["../src/dev/devContext.ts"],"sourcesContent":["import type DevContext from \"./types/DevContext\";\n\nconst noop = () => {};\n\nconst devContext: DevContext = {\n\tenabled: false,\n\tdepth: 0,\n\tindex: -1,\n\tboundaries: [],\n\n\tformat: () => \"\",\n\tgetDetails: () => \"\",\n\tunmark: noop,\n\tmark: noop,\n\n\t// Hooks\n\tonWatch: noop,\n\tonRun: noop,\n\tonRegionPushed: noop,\n\tonRegionPopped: noop,\n\tonRegionCleared: noop,\n\n\tsignalSet: noop,\n\teffectRun: noop,\n};\n\n// Add to globalThis for getting from the extension\n// @ts-ignore\nglobalThis.T_DEV_CTX = devContext;\n\nexport default devContext;\n"],"mappings":";;AAEA,MAAM,aAAa;AAEnB,MAAMA,aAAyB;CAC9B,SAAS;CACT,OAAO;CACP,OAAO;CACP,YAAY,EAAE;CAEd,cAAc;CACd,kBAAkB;CAClB,QAAQ;CACR,MAAM;CAGN,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB,gBAAgB;CAChB,iBAAiB;CAEjB,WAAW;CACX,WAAW;CACX;AAID,WAAW,YAAY;AAEvB,yBAAe"}
|