@ai-matrx/summon 0.1.9 → 0.1.10

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +24 -0
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.10
4
+
5
+ UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
+ Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/summon/src`.
7
+
3
8
  ## 0.1.9
9
+
10
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
11
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
12
+ Diff: `git diff b3962adfda 33bf3a23be -- apps/shared/summon/src`
13
+
14
+ Changed shipped source files (3):
15
+ - `apps/shared/summon/src/core/augment.ts`
16
+ - `apps/shared/summon/src/core/types.ts`
17
+ - `apps/shared/summon/src/index.ts`
18
+
19
+ ## 0.1.8
4
20
  ### Unreleased
5
21
 
6
22
  - **New: `./open` and `./root` — a page pays next to nothing until something opens.** `./open` (framework-free) holds the action creators (plain objects carrying the slices' own type strings: `openOverlay`, `closeOverlay`, `toggleOverlay`, `closeAllInstancesOfOverlay`, `closeOverlaysBoundToPage`, `closeAllOverlays`, `pruneStaleInstances`, `focusWindow`, `restoreWindow`, `toggleWindowsHidden`, `restoreAll`, `minimizeAll`), selectors that read "closed" while the slices are absent, the registry, ports, and `createSummonGate()`. `./root` holds `<SummonRoot store runtime …settings>`, the store hooks, `defineOverlay` and the instance context. The gate is one middleware in a host store: the store carries no summon slice or middleware; the first summon action queues and starts ONE `import()` of the core, which installs itself on evaluation (injects the slices through the host's `attachReducer` inject, adds the close lifecycle + render watchdog, replays the queue). Any module that imports the core statically (the window section, links, persistence) installs it before it renders. `<SummonRoot>` records the host settings (ports, renderWrapper, errorReportExtras, windows) once; `useSummonPorts`, `useSummonConfig` and `useWindowConfig` fall back to them when no provider is above, so a page's own WindowPanel and the lazily loaded host need no provider. Callback-aware opens reserve their event channel id and the handles registry arrives with that first open (`openPendingEventChannel`). Measured in AI Matrx: summon first load per route 73 KB min / 23 KB gz before. Guards: `src/importCost.test.ts` (`./open`/`./root` reach no slice, middleware, react section, window or handles), `src/open/gate.test.ts`, `src/open/actions.parity.test.ts`, `src/root/summonRoot.test.tsx`. Consumer action: none for hosts that mount `summonReducers` or use `<SummonProvider>`; to drop summon from first load, mount `createSummonGate()` + `<SummonRoot>` instead and import openers/selectors from `./open`, `defineOverlay` from `./root`.
package/README.md CHANGED
@@ -201,6 +201,30 @@ Pass the same `ports` object to both. The overlays slice keys are fixed. Without
201
201
 
202
202
  Provider knobs: `fallbacks` (`loading`, `error` components), `errorReportExtras` (extra controls in the error card), `renderWrapper` (wrap every rendered overlay), `keepAliveLimit` (8), `importTimeoutMs` (12 s; a render module that has not loaded becomes a `ChunkLoadError` with Try again), `stallWarnMs` (10 s).
203
203
 
204
+ ### Pay only when something opens: the gate
205
+
206
+ A large app keeps summon out of every route's first load: the store carries no summon slice or
207
+ middleware, and the root mounts only `<SummonRoot>`.
208
+
209
+ ```tsx
210
+ import { configureStore } from "@reduxjs/toolkit";
211
+ import { createSummonGate } from "@ai-matrx/summon/open";
212
+ import { SummonRoot } from "@ai-matrx/summon/root";
213
+
214
+ const gate = createSummonGate({ ports });
215
+ const root = createInjectableRootReducer(); // your combineReducers wrapper with an inject(reducers)
216
+ gate.attachReducer((reducers) => root.inject(reducers));
217
+ export const store = configureStore({ reducer: root, middleware: (g) => g().concat(gate.middleware) });
218
+
219
+ <SummonRoot store={store} ports={ports} runtime={() => import("./WindowRuntime")}>{app}</SummonRoot>;
220
+ ```
221
+
222
+ Openers and selectors come from `./open`, `defineOverlay` from `./root`. The first summon action is
223
+ queued and starts one `import()` of the core, which injects the slices, adds the middleware and
224
+ replays the queue; a module that imports the core statically (a page's `WindowPanel`) installs it
225
+ before it renders. `runtime` (tray sync, router port) mounts once the core is installed.
226
+ `prefetchSummonRuntime()` starts the load early (idle, pointer intent).
227
+
204
228
  ## Ports
205
229
 
206
230
  Every port has a working default, so a bare host needs none. Override only what you have; pass them as `ports` on the provider (a partial object).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/summon",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Render any React component by dispatch and never mount it until it is needed: single or multi instance, handles for callbacks and refs beside Redux, keep-alive and saved component state, address-bar links bound to data, optional persistence, and a full windowing desktop in the browser.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -268,5 +268,5 @@
268
268
  "check:package": "pnpm build && node ../scripts/check-exports-agreement.mjs && publint && pnpm verify:tarball && node ../scripts/check-tarball-relative-imports.mjs --self-test && node ../scripts/check-tarball-relative-imports.mjs --pack . && node ../scripts/check-package-rules.mjs --self-test && node ../scripts/check-package-rules.mjs .",
269
269
  "verify:tarball": "node scripts/verify-tarball.mjs"
270
270
  },
271
- "gitHead": "33bf3a23be8fb91ad5f697e2542bf311892f5863"
271
+ "gitHead": "24a38ba9270ef406d289f06c8172aaa2d9b6decb"
272
272
  }