@lukekaalim/act-backstage 3.0.0 → 3.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @lukekaalim/act-backstage
2
2
 
3
+ ## 3.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @lukekaalim/act-recon@4.0.0
9
+ - @lukekaalim/act@4.2.0
10
+
11
+ ## 3.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - bcbd299: SSR API for @lukekaalim/act-web
16
+
17
+ ### Patch Changes
18
+
19
+ - beec21c: Fixed Web text element rehydration, remove nodejs dependencies from dehydration
20
+ - Updated dependencies [bcbd299]
21
+ - Updated dependencies [beec21c]
22
+ - @lukekaalim/act-recon@3.1.0
23
+ - @lukekaalim/act@4.1.0
24
+
3
25
  ## 3.0.0
4
26
 
5
27
  ### Major Changes
package/builder.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Element } from "@lukekaalim/act";
2
+ import { CommitRef2 } from "@lukekaalim/act-recon";
2
3
 
3
4
  /**
4
5
  * This type describes an implementation
@@ -8,7 +9,7 @@ import { Element } from "@lukekaalim/act";
8
9
  export type NodeBuilder<TNode, TRoot = string | symbol> = {
9
10
  roots: Set<TRoot>,
10
11
 
11
- create: (element: Element, root: TRoot) => null | TNode,
12
+ create: (element: Element, root: TRoot, ref: CommitRef2) => null | TNode,
12
13
  destroy?: (el: TNode) => unknown,
13
14
 
14
15
  linkRoot?: (child: TNode) => unknown,
@@ -17,7 +18,7 @@ export type NodeBuilder<TNode, TRoot = string | symbol> = {
17
18
  unlink?: (child: TNode, parent: TNode) => unknown,
18
19
 
19
20
  sort?: (el: TNode, children: readonly TNode[]) => unknown,
20
- update?: (el: TNode, next: Element, prev: null | Element) => unknown,
21
+ update?: (el: TNode, next: Element, prev: null | Element, ref: CommitRef2) => unknown,
21
22
 
22
23
  suspend?: (el: TNode, parent: TNode) => void,
23
24
  unsuspend?: (el: TNode, parent: TNode) => void,
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@lukekaalim/act-backstage",
3
- "version": "3.0.0",
3
+ "version": "3.1.1",
4
+ "type": "module",
4
5
  "main": "mod.ts",
5
6
  "dependencies": {
6
- "@lukekaalim/act": "^4.0.0",
7
- "@lukekaalim/act-recon": "^3.0.0"
7
+ "@lukekaalim/act": "^4.2.0",
8
+ "@lukekaalim/act-recon": "^4.0.0"
8
9
  }
9
10
  }
package/space2.ts CHANGED
@@ -141,7 +141,7 @@ export class RenderSpace2<TNode, TRoot extends string | symbol> {
141
141
  // belongs to this
142
142
  if (this.builder.roots.has(rootType) ) {
143
143
  // Try to create a <T> for every new commit
144
- const node = this.builder.create(next.element, rootType);
144
+ const node = this.builder.create(next.element, rootType, next.ref);
145
145
  // Not all commits have a corresponding node
146
146
  if (node) {
147
147
  this.newNodes.add([next, node]);
@@ -170,9 +170,6 @@ export class RenderSpace2<TNode, TRoot extends string | symbol> {
170
170
  for (const [next, node] of this.newNodes) {
171
171
  const result = this.findParent(next.ref);
172
172
 
173
- if (next.element.type === specialNodeTypes.suspend)
174
- console.log(`Creating suspense node`, result)
175
-
176
173
  if (result.commit && result.node && result.attachable) {
177
174
  this.needsReorder.add(result.commit.ref.id)
178
175
 
@@ -217,7 +214,7 @@ export class RenderSpace2<TNode, TRoot extends string | symbol> {
217
214
  if (!node)
218
215
  continue;
219
216
 
220
- update(node, next.element, prev);
217
+ update(node, next.element, prev, next.ref);
221
218
 
222
219
  if (moved) {
223
220
  const result = this.findParent(next.ref);
@@ -230,7 +227,7 @@ export class RenderSpace2<TNode, TRoot extends string | symbol> {
230
227
  for (const next of deltas.fresh.values()) {
231
228
  const node = this.nodeByCommit.get(next.ref.id);
232
229
  if (node)
233
- update(node, next.element, null);
230
+ update(node, next.element, null, next.ref);
234
231
  }
235
232
  }
236
233
  for (const prev of deltas.removed.values()) {
@@ -261,4 +258,4 @@ export class RenderSpace2<TNode, TRoot extends string | symbol> {
261
258
  }
262
259
  }
263
260
  }
264
- }
261
+ }