@lukekaalim/act-recon 1.1.0 → 1.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 +6 -0
- package/element.ts +0 -1
- package/package.json +1 -1
- package/thread.ts +6 -13
package/CHANGELOG.md
CHANGED
package/element.ts
CHANGED
package/package.json
CHANGED
package/thread.ts
CHANGED
|
@@ -46,7 +46,6 @@ export const WorkThread = {
|
|
|
46
46
|
* Remove all changes from a particular commit onward
|
|
47
47
|
*/
|
|
48
48
|
rollback(thread: WorkThread, from: CommitRef) {
|
|
49
|
-
console.log(`rolling back changes from ${from.id} in thread`);
|
|
50
49
|
thread.deltas.created = thread.deltas.created.filter(d => !isDescendant(from, d.ref));
|
|
51
50
|
thread.deltas.updated = thread.deltas.updated.filter(d => !isDescendant(from, d.ref));
|
|
52
51
|
thread.deltas.removed = thread.deltas.removed.filter(d => !isDescendant(from, d.ref));
|
|
@@ -63,7 +62,6 @@ export const WorkThread = {
|
|
|
63
62
|
* */
|
|
64
63
|
findClosestBoundary(thread: WorkThread, tree: CommitTree, ref: CommitRef): Commit | null {
|
|
65
64
|
return last(ref.path, id => {
|
|
66
|
-
console.log(ref.path, id);
|
|
67
65
|
if (tree.commits.has(id)) {
|
|
68
66
|
const commit = tree.commits.get(id) as Commit;
|
|
69
67
|
if (commit.element.type === errorBoundaryType)
|
|
@@ -131,16 +129,12 @@ export const createThreadManager = (
|
|
|
131
129
|
for (const delta of currentThread.deltas.removed)
|
|
132
130
|
tree.commits.delete(delta.ref.id);
|
|
133
131
|
|
|
134
|
-
console.log(currentThread.errorNotifications);
|
|
135
132
|
for (const boundaryId of currentThread.errorNotifications) {
|
|
136
133
|
const commit = tree.commits.get(boundaryId) as Commit;
|
|
137
134
|
const { onError } = commit.element.props as ErrorBoundaryProps;
|
|
138
|
-
console.log({commit});
|
|
139
135
|
if (typeof onError === 'function') {
|
|
140
136
|
const state = CommitTree.getError(tree, commit.id);
|
|
141
|
-
console.log('informing the candidate')
|
|
142
137
|
const clear = () => {
|
|
143
|
-
console.log('clearing the error!')
|
|
144
138
|
ErrorBoundaryState.clear(state);
|
|
145
139
|
request(commit);
|
|
146
140
|
}
|
|
@@ -176,7 +170,6 @@ export const createThreadManager = (
|
|
|
176
170
|
updateOnPath.targets.push(target);
|
|
177
171
|
}
|
|
178
172
|
} else {
|
|
179
|
-
console.log('adding pending task')
|
|
180
173
|
pendingUpdateTargets.set(target.id, target);
|
|
181
174
|
}
|
|
182
175
|
} else {
|
|
@@ -212,7 +205,7 @@ export const createThreadManager = (
|
|
|
212
205
|
if (identicalChange) {
|
|
213
206
|
const isOnTargetPath = targets.some(target => target.path.includes(ref.id));
|
|
214
207
|
if (!isOnTargetPath)
|
|
215
|
-
return
|
|
208
|
+
return;
|
|
216
209
|
|
|
217
210
|
const isSpecificallyTarget = targets.some(target => target.id === ref.id);
|
|
218
211
|
|
|
@@ -222,7 +215,7 @@ export const createThreadManager = (
|
|
|
222
215
|
|
|
223
216
|
const commit = Commit.version(prev);
|
|
224
217
|
thread.deltas.skipped.push({ next: commit });
|
|
225
|
-
return
|
|
218
|
+
return;
|
|
226
219
|
}
|
|
227
220
|
}
|
|
228
221
|
if (next) {
|
|
@@ -236,7 +229,7 @@ export const createThreadManager = (
|
|
|
236
229
|
WorkThread.notifyError(thread, errorBoundary);
|
|
237
230
|
|
|
238
231
|
thread.pendingUpdates.push(Update.target(errorBoundary));
|
|
239
|
-
return
|
|
232
|
+
return;
|
|
240
233
|
} else {
|
|
241
234
|
console.error(output.reject);
|
|
242
235
|
console.error(`No boundary to catch error: Unmounting roots`);
|
|
@@ -261,9 +254,9 @@ export const createThreadManager = (
|
|
|
261
254
|
const commit = Commit.update(ref, next, childRefs);
|
|
262
255
|
|
|
263
256
|
if (prev)
|
|
264
|
-
|
|
257
|
+
thread.deltas.updated.push({ ref, prev, next: commit });
|
|
265
258
|
else
|
|
266
|
-
|
|
259
|
+
thread.deltas.created.push({ ref, next: commit });
|
|
267
260
|
|
|
268
261
|
// Update tree
|
|
269
262
|
//tree.commits.set(ref.id, commit);
|
|
@@ -275,7 +268,7 @@ export const createThreadManager = (
|
|
|
275
268
|
thread.deltas.removed.push({ ref: prev, prev });
|
|
276
269
|
thread.pendingUpdates.push(...prevChildren.map(prev => Update.remove(prev)));
|
|
277
270
|
thread.pendingEffects.push(...output.effects);
|
|
278
|
-
return
|
|
271
|
+
return;
|
|
279
272
|
} else {
|
|
280
273
|
throw new Error(`No prev, no next, did this commit ever exist?`)
|
|
281
274
|
}
|