@spearwolf/shadow-objects 0.30.2 → 0.32.0
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 +23 -1
- package/bundle.js +13 -13
- package/package.json +3 -3
- package/src/bundle.js +4 -4
- package/src/bundle.js.map +7 -1
- package/src/constants.js +53 -40
- package/src/constants.js.map +7 -1
- package/src/create-worker.bundle.js +6 -8
- package/src/create-worker.bundle.js.map +7 -1
- package/src/create-worker.js +5 -2
- package/src/create-worker.js.map +7 -1
- package/src/elements/ShaeElement.js +57 -54
- package/src/elements/ShaeElement.js.map +7 -1
- package/src/elements/ShaeEntElement.d.ts.map +1 -1
- package/src/elements/ShaeEntElement.js +320 -341
- package/src/elements/ShaeEntElement.js.map +7 -1
- package/src/elements/ShaePropElement.js +312 -320
- package/src/elements/ShaePropElement.js.map +7 -1
- package/src/elements/ShaeWorkerElement.js +234 -229
- package/src/elements/ShaeWorkerElement.js.map +7 -1
- package/src/elements/constants.js +37 -22
- package/src/elements/constants.js.map +7 -1
- package/src/elements/events.d.ts +1 -1
- package/src/elements/events.d.ts.map +1 -1
- package/src/elements/events.js +1 -2
- package/src/elements/events.js.map +7 -1
- package/src/elements.js +4 -4
- package/src/elements.js.map +7 -1
- package/src/in-the-dark/Entity.d.ts +1 -1
- package/src/in-the-dark/Entity.d.ts.map +1 -1
- package/src/in-the-dark/Entity.js +299 -293
- package/src/in-the-dark/Entity.js.map +7 -1
- package/src/in-the-dark/Kernel.d.ts.map +1 -1
- package/src/in-the-dark/Kernel.js +556 -533
- package/src/in-the-dark/Kernel.js.map +7 -1
- package/src/in-the-dark/Registry.d.ts.map +1 -1
- package/src/in-the-dark/Registry.js +101 -104
- package/src/in-the-dark/Registry.js.map +7 -1
- package/src/in-the-dark/ShadowObject.d.ts.map +1 -1
- package/src/in-the-dark/ShadowObject.js +21 -23
- package/src/in-the-dark/ShadowObject.js.map +7 -1
- package/src/in-the-dark/SignalsPath.d.ts.map +1 -1
- package/src/in-the-dark/SignalsPath.js +139 -123
- package/src/in-the-dark/SignalsPath.js.map +7 -1
- package/src/in-the-dark/events.js +11 -9
- package/src/in-the-dark/events.js.map +7 -1
- package/src/in-the-dark/importModule.js +31 -29
- package/src/in-the-dark/importModule.js.map +7 -1
- package/src/index.d.ts +2 -2
- package/src/index.d.ts.map +1 -1
- package/src/index.js +14 -14
- package/src/index.js.map +7 -1
- package/src/shadow-objects.js +6 -6
- package/src/shadow-objects.js.map +7 -1
- package/src/shadow-objects.worker.js +3 -3
- package/src/shadow-objects.worker.js.map +7 -1
- package/src/shae-ent.js +3 -3
- package/src/shae-ent.js.map +7 -1
- package/src/shae-prop.js +3 -3
- package/src/shae-prop.js.map +7 -1
- package/src/shae-worker.js +3 -3
- package/src/shae-worker.js.map +7 -1
- package/src/types.d.ts +3 -2
- package/src/types.d.ts.map +1 -1
- package/src/types.js +1 -2
- package/src/types.js.map +7 -1
- package/src/utils/ConsoleLogger.js +179 -185
- package/src/utils/ConsoleLogger.js.map +7 -1
- package/src/utils/FrameLoop.js +41 -40
- package/src/utils/FrameLoop.js.map +7 -1
- package/src/utils/array-utils.js +22 -24
- package/src/utils/array-utils.js.map +7 -1
- package/src/utils/attr-utils.js +15 -11
- package/src/utils/attr-utils.js.map +7 -1
- package/src/utils/constants.js +5 -2
- package/src/utils/constants.js.map +7 -1
- package/src/utils/generateUUID.d.ts.map +1 -1
- package/src/utils/generateUUID.js +269 -32
- package/src/utils/generateUUID.js.map +7 -1
- package/src/utils/props-utils.js +34 -43
- package/src/utils/props-utils.js.map +7 -1
- package/src/utils/toMaybe.js +5 -2
- package/src/utils/toMaybe.js.map +7 -1
- package/src/utils/toNamespace.js +6 -3
- package/src/utils/toNamespace.js.map +7 -1
- package/src/utils/toUrlString.js +9 -6
- package/src/utils/toUrlString.js.map +7 -1
- package/src/utils/waitForMessageOfType.js +30 -32
- package/src/utils/waitForMessageOfType.js.map +7 -1
- package/src/view/ComponentChanges.d.ts +1 -1
- package/src/view/ComponentChanges.d.ts.map +1 -1
- package/src/view/ComponentChanges.js +249 -251
- package/src/view/ComponentChanges.js.map +7 -1
- package/src/view/ComponentContext.d.ts.map +1 -1
- package/src/view/ComponentContext.js +303 -331
- package/src/view/ComponentContext.js.map +7 -1
- package/src/view/ComponentMemory.d.ts +1 -0
- package/src/view/ComponentMemory.d.ts.map +1 -1
- package/src/view/ComponentMemory.js +73 -76
- package/src/view/ComponentMemory.js.map +7 -1
- package/src/view/IShadowObjectEnvProxy.js +1 -2
- package/src/view/IShadowObjectEnvProxy.js.map +7 -1
- package/src/view/LocalShadowObjectEnv.d.ts.map +1 -1
- package/src/view/LocalShadowObjectEnv.js +57 -52
- package/src/view/LocalShadowObjectEnv.js.map +7 -1
- package/src/view/RemoteWorkerEnv.js +134 -123
- package/src/view/RemoteWorkerEnv.js.map +7 -1
- package/src/view/ShadowEnv.d.ts.map +1 -1
- package/src/view/ShadowEnv.js +232 -228
- package/src/view/ShadowEnv.js.map +7 -1
- package/src/view/ViewComponent.d.ts +9 -0
- package/src/view/ViewComponent.d.ts.map +1 -1
- package/src/view/ViewComponent.js +142 -130
- package/src/view/ViewComponent.js.map +7 -1
- package/src/view/cloneChangeTrail.js +13 -11
- package/src/view/cloneChangeTrail.js.map +7 -1
- package/src/worker/MessageRouter.d.ts.map +1 -1
- package/src/worker/MessageRouter.js +78 -67
- package/src/worker/MessageRouter.js.map +7 -1
- package/src/worker/WorkerRuntime.js +22 -21
- package/src/worker/WorkerRuntime.js.map +7 -1
- package/tsconfig.lib.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ All notable changes to [@spearwolf/shadow-objects](https://github.com/spearwolf/
|
|
|
5
5
|
The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
> Build-system, monorepo, lint/format, and dev-workflow changes that don't affect the shipped package are tracked in the top-level [`CHANGELOG.md`](../../CHANGELOG.md).
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
## [0.32.0] - 2026-05-13
|
|
13
|
+
|
|
14
|
+
- Runtime dependencies bumped: `@spearwolf/eventize` `^4.3.1` → `^5.0.0`, `@spearwolf/signalize` `^0.28.0` → `^0.29.0`. The eventize 5.0.0 major bump only changes `emit()`/`emitAsync()` on *non-eventized* targets (they now duck-type into the target's matching method or `.emit()` instead of throwing); all internal `emit()` call-sites in shadow-objects target eventized objects, so the change is transparent. signalize 0.29.0 itself bundles the same eventize bump plus a docs rewrite — no runtime-behavior change for shadow-objects. Verified with `pnpm cbt` (7 turbo tasks, 191 unit/integration + 44 e2e tests).
|
|
15
|
+
|
|
16
|
+
## [0.31.0] - 2026-05-09
|
|
17
|
+
|
|
18
|
+
- **Bugfix (entity lifecycle, KERN-3):** `kernel.destroyEntity()` now handles its children explicitly instead of leaving them as orphaned entries inside the kernel. Children with `autoDestructionOnParentRemoval` cascade-destroy together with the parent; all other children are promoted to root entities and remain reachable. This fixes a real leak where children without the auto-destruct flag were left in `kernel.#entities` after the parent was destroyed.
|
|
19
|
+
- **Bugfix (entity lifecycle, KERN-2):** `autoDestructionOnParentRemoval` now survives re-parenting. The subscription is rebound to the new parent on every parent change (`Entity.parentUuid` setter / `Kernel.setParent()`), so a re-parented child is no longer destroyed when its *original* parent dies, and is correctly destroyed with its *current* parent.
|
|
20
|
+
- **Bugfix (change trail, KERN-1):** the `autoDestructionOnParentRemoval` flag is now carried end-to-end through the change-trail pipeline. `ICreateEntitiesChange` exposes a new optional `autoDestructionOnParentRemoval?: boolean` field, `ComponentChanges.create()` accepts it as a 4th parameter, and `Kernel.run()`/`parse()` forwards it to `createEntity()`. Previously the kernel parameter existed but the trail-based path (worker and local env) never set it, so the feature was unreachable in production.
|
|
21
|
+
- **New (public API):** `ViewComponent` accepts an `autoDestructionOnParentRemoval?: boolean` constructor option (also exposed as a read-only getter); the value flows through `ComponentContext.addComponent()` into the change trail, and survives `ContextLost` recovery via `ComponentMemory`. Backwards-compatible (defaults to `false`).
|
|
22
|
+
- **Bugfix (entity lifecycle, KERN-5):** `Entity.parentUuid` setter and `Kernel.setParent()` now resolve the new parent UUID *before* detaching from the current parent. A `setParent` call with an unknown UUID throws as before but the entity stays attached to its original parent instead of being orphaned mid-mutation.
|
|
23
|
+
- **Bugfix (registry, KERN-6):** `Registry.clear()` now also clears the prop-based (`@`-prefix) routes. Previously they accumulated across `clear()` calls, polluting tests and long-lived registries.
|
|
24
|
+
- **DX (creation API, KERN-7):** `useProperty()`, `useContext()`, and `useParentContext()` now warn when a subsequent call passes a different `{compare}` function than the first call. The cached signal is created once with the original options; subsequent calls silently returned the cached reader, which could lead to surprising equality semantics. New behavior: still returns the cached reader, but emits a `console.warn` so the mismatch is visible.
|
|
25
|
+
- **Bugfix (BFS cache, KERN-4):** `kernel.destroyEntity()` now invalidates the BFS traversal cache. Previously, programmatic destruction (e.g. through an auto-destroy listener) could leave `traverseLevelOrderBFS()` returning stale UUIDs.
|
|
26
|
+
- **Bugfix (`./bundle.js` export):** the published `dist/bundle.js` now actually contains the inlined worker and the shae-element registrations. Previous releases shipped a 790-byte stub that only set `globalThis.SHADOW_ENTS_BUNDLE_LOADED = true` because the source-side `package.json#sideEffects` array referenced the (no-longer-emitted) intermediate `build/src/*` paths and the bundle entry was tree-shaken. Consumers using `import '@spearwolf/shadow-objects/bundle.js'` now get the full bundle (~130 KB).
|
|
27
|
+
- **Cleanup:** the published `dist/` no longer contains the leftover `tsconfig.lib.tsbuildinfo` build artifact.
|
|
28
|
+
- Runtime dependencies updated: `@spearwolf/eventize@^4.3.1`, `@spearwolf/signalize@^0.28.0`.
|
|
29
|
+
|
|
8
30
|
## [0.30.2] - 2026-02-26
|
|
9
31
|
|
|
10
32
|
- **API Update:** When calling the `kernel.createEntity()` function, there is now a new parameter `autoDestructionOnParentRemoval`. This makes it easier to create entities yourself from inside a shadow-object.
|
|
@@ -117,4 +139,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
117
139
|
- enhance the shadow-objects creation api _aka_ `ShadowObjectParams`
|
|
118
140
|
- added the `useProperties()` function
|
|
119
141
|
- added the `useResource()` function
|
|
120
|
-
- added lots of new tests and improved code coverage
|
|
142
|
+
- added lots of new tests and improved code coverage
|