@fullstackunicorn/webapp 2.0.5 → 2.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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.5",
2
+ "version": "2.1.1",
3
3
  "name": "@fullstackunicorn/webapp",
4
4
  "author": "lucanigido (https://fullstackunicorn.dev/author/lucanigido)",
5
5
  "description": "Shared Web and Native runtime engines and core components for Fullstack Unicorn applications",
@@ -10,6 +10,7 @@
10
10
  "files": [
11
11
  "index.js",
12
12
  "index.dep.js",
13
+ "files.json",
13
14
  "imports/",
14
15
  "load/",
15
16
  "native/",
package/package.md CHANGED
@@ -7,20 +7,78 @@ Shared Web and Native runtime engines and React core components used by Fullstac
7
7
  Applications import this package only through their canonical dependency barrel. Package-internal third-party imports are centralized in `index.dep.js`. Host-specific configuration, data, pages, routes and styles remain in the application.
8
8
 
9
9
  The load engine lives in `load/` and its component entry point is `load/Load.js`.
10
- It reads host settings from `configure/load.json`, checks `/pulse`, reports a
11
- complete or partial cache inventory to `POST /api/data/load/get`, applies only
12
- `delete`, `replace` and `new` operations from the one BFF response, and resolves
13
- initial image sizes through the host's `load/geometry.scope.js`. Before reporting
14
- an inventory as complete, it verifies that every declared JSON resource and image
15
- binary is actually present at the declared version in browser cache. Hosts may use
16
- the `Load` component's `onReady` callback to initialize page content only after
17
- the required JSON resources have been reconciled. Image warming continues in
18
- parallel and shares the same requests and cache with mounted `Img` components.
19
- The resource-ready state is committed before content initialization, while the
20
- complete state is committed only after image warming finishes.
21
- Parent renders keep the active Load job alive, and a cancelled request propagates
22
- as `AbortError` instead of being validated as a Data bundle.
10
+ `Pulse` owns the single visibility-aware scheduler and observes every active Data
11
+ source independently of optional prefetch. `Load` reads host settings from
12
+ `configure/load.json`; `enabled: false` leaves only that prefetch component
13
+ unmounted. Normal content never waits for Pulse, a bundle or `onReady`.
14
+
15
+ Public CDN JSON from normal GETs and bundled values shares the same physical
16
+ cache entry, keyed by the canonical endpoint and method. Each entry retains the
17
+ origin SHA, source URL and Data revision. A qualified entry has no TTL: repeated
18
+ reads perform no HTTP until Pulse observes a different source revision or the
19
+ physical entry is missing. Legacy entries without that identity validate once
20
+ through the normal reader, without clearing unrelated cache. Conditional 304
21
+ responses and HTTP 200 writes share the existing serialized per-key commit.
22
+ The observed source state stores revision and publication cursor. Reads use the
23
+ existing `?release=<cursor>` transport when available, preserving the canonical
24
+ cache key, and reject contradictory response revisions. A Code-only cursor
25
+ change does not invalidate content at the same Data revision. A cold request
26
+ already in flight is shared when the first Pulse confirms its response.
27
+
28
+ Load projects its inventory from the same physical JSON cache plus its selected
29
+ image descriptors and sends that exact snapshot to `POST /api/data/load/get`.
30
+ The single response carries only `delete`, `replace` and `new` operations.
31
+ `delete` removes selection membership, preserving ordinary cached resources.
32
+ Already-cached raw JSON is advertised by the same origin SHA, so it is not sent
33
+ again in the bundle. Host readers qualify media from that resource's CDN and
34
+ explicit source mappings; bundled JSON remains identical to ordinary GET data.
35
+ The resources-ready state records JSON completion; complete state also includes
36
+ image warming. Neither state gates page content. Every subsequent check verifies
37
+ physical presence before reusing a completed state. Geometry comes from the
38
+ host's `load/geometry.scope.js`, and warming shares the transport/cache used by
39
+ mounted images. Parent renders retain the current Load job; cancellation remains
40
+ an `AbortError` rather than an invalid bundle.
23
41
  The shared
24
42
  `Img` component measures its mounted container, treats `src + hash` as binary
25
43
  identity and keeps the decoded displayed image visible until a changed pending
26
44
  binary has decoded and cross-faded.
45
+
46
+ Shared runtime sources remain byte-sacred after extraction. `files.json` uses the
47
+ same `version`, `reference` and `files` contract as Root, with an exact SHA-256 for
48
+ every runtime path and its original reference hash. The 66 transferred frontend
49
+ files refer to the retained pre-extraction baseline; the 66 package-only files,
50
+ including Native adapters and package entry points, retain the existing 2.0.5
51
+ source as their reference. The two file-operation modules retain the exact
52
+ existing Fullstack 2.1.0 candidate bytes as their reference. All 134 runtime
53
+ sources remain protected; shared package code has no unprotected category.
54
+ The test gate checks the fixed manifest, exact runtime inventory and file bytes;
55
+ it never regenerates expected hashes from a modified working tree.
56
+
57
+ The recovery corrections affect four existing files: `cache.js` stores
58
+ the JSON hash separately, `client.js` preserves chronological version checks and
59
+ legacy cache reads, and `Load.js` refreshes later Data changes after initial
60
+ readiness. `engine.js` verifies inventory before its completion shortcut, fixing
61
+ a storage-presence assumption already present in the original preloader. The
62
+ NPM extraction does not authorize rewriting these bodies; the separate Load
63
+ feature and these demonstrated corrections account for their reviewed changes.
64
+ A manifest change requires review of the exact source difference.
65
+
66
+ The 2.1.0 candidate also preserves the existing Fullstack feature delta exactly:
67
+ Web `Link` and `Pressable` forward focus/blur callbacks, and Web/Native
68
+ `imports/files.js` retain their existing implementations. The Web helpers copy
69
+ and download text; the Native adapters retain their explicit unsupported errors.
70
+ The existing wildcard exports expose these modules without a new export surface.
71
+ Only those four feature files were transferred from the older 2.0.0-based
72
+ candidate; subsequent shared runtime corrections were retained. Metadata and
73
+ the choice of title source remain unchanged, pending Luca's decision.
74
+
75
+ Version 2.1.1 implements Luca's explicit single-registry, Pulse-only invalidation
76
+ contract. The six reviewed runtime deltas are `imports/cache.js`,
77
+ `imports/client.js`, `load/Load.js`, `load/engine.js`, `load/resources.js` and
78
+ `load/use.js`. The existing request ownership module is unchanged. Tests cover
79
+ legacy migration, no-TTL hits, source isolation, cold-request sharing, release
80
+ pinning, Code-only reuse, optional prefetch, raw inventory deduplication,
81
+ deselection without eviction, and physical-cache recovery. A bundle of another
82
+ observed revision cannot replace current data. Within the same observed revision,
83
+ an older completion cannot replace newer committed JSON, including conditional
84
+ 304 responses; an explicitly Pulse-selected rollback remains valid.