@ai-matrx/summon 0.1.8 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
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
+
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
+
3
19
  ## 0.1.8
4
20
  ### Unreleased
5
21
 
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).
@@ -1,3 +1,4 @@
1
+ import { OverlayHostTypes, OverlayRegistry } from '@ai-matrx/summon';
1
2
  import { Reducer, Middleware } from '@reduxjs/toolkit';
2
3
 
3
4
  /**
@@ -18,8 +19,7 @@ import { Reducer, Middleware } from '@reduxjs/toolkit';
18
19
  * `defineOverlay` emits nothing at runtime for this; the augmentation is the host's one-line
19
20
  * declaration per overlay (the converter writes it next to each definition).
20
21
  */
21
- interface OverlayRegistry {
22
- }
22
+
23
23
  /** Every registered overlay id; plain `string` until the host augments the registry. */
24
24
  type OverlayId = [keyof OverlayRegistry] extends [never] ? string : Extract<keyof OverlayRegistry, string>;
25
25
  /** The open-data type declared for an overlay id. */
@@ -96,8 +96,6 @@ interface OverlayWindowOptions {
96
96
  *
97
97
  * declare module "@ai-matrx/summon" { interface OverlayHostTypes { dispatch: AppDispatch } }
98
98
  */
99
- interface OverlayHostTypes {
100
- }
101
99
  type OverlayHostDispatch = OverlayHostTypes extends {
102
100
  dispatch: infer D;
103
101
  } ? D : (action: unknown) => unknown;
@@ -396,4 +394,4 @@ interface CreateSummonGateOptions {
396
394
  }
397
395
  declare function createSummonGate(options?: CreateSummonGateOptions): SummonGate;
398
396
 
399
- export { isRegisteredOverlay as $, type AnyOverlayMeta as A, anonymousIdentity as B, type CloseOverlaysBoundToPagePayload as C, DEFAULT_INSTANCE_ID as D, type ErrorSinkPort as E, closeAllInstancesOfOverlay as F, closeOverlay as G, closeOverlaysBoundToPage as H, type InstanceKey as I, consoleErrorSink as J, type KeepAlive as K, type LinkHydrateContext as L, type MobilePresentation as M, type NotifyOptions as N, type OverlayState as O, type PruneStaleInstancesPayload as P, consoleNotify as Q, type RawOpenPayload as R, type SummonPorts as S, type ToggleOverlayPayload as T, type UnbiddenHomeRoute as U, debugOff as V, type WindowPreservation as W, defaultWindowIdFor as X, getOverlayMeta as Y, getOverlayMetaByLinkKey as Z, instanceKey as _, type StateWithOverlays as a, listOpenInstanceKeys as a0, locationRouter as a1, openOverlay as a2, overlayIdsBoundToPage as a3, parseInstanceKey as a4, registerOverlayMeta as a5, resetOverlayRegistry as a6, resolvePorts as a7, selectIsOverlayOpen as a8, selectOpenInstances as a9, selectOverlay as aa, selectOverlayData as ab, subscribeToOverlayRegistry as ac, toggleOverlay as ad, type CreateSummonGateOptions as ae, SUMMON_INSTALLED_ACTION as af, SUMMON_SLICE_KEYS as ag, type SummonAction as ah, type SummonGate as ai, closeAllOverlays as aj, createSummonGate as ak, ensureSummonRuntime as al, focusWindow as am, installSummonCore as an, isSummonAction as ao, isSummonInstalled as ap, minimizeAll as aq, prefetchSummonRuntime as ar, pruneStaleInstances as as, restoreAll as at, restoreWindow as au, selectAnyOverlayTouched as av, selectWindowsHidden as aw, subscribeSummonInstalled as ax, toggleWindowsHidden as ay, type OverlayDefinitionMeta as b, type SummonCore as c, type CloseAllInstancesPayload as d, type CloseOverlayPayload as e, DEFAULT_PORTS as f, type DebugPort as g, type IdentityPort as h, type InstanceMode as i, type NotifyPort as j, type OpenInstanceView as k, type OpenOverlayPayload as l, type OverlayDataOf as m, type OverlayHostDispatch as n, type OverlayHostTypes as o, type OverlayId as p, type OverlayInstance as q, type OverlayLinkSpec as r, type OverlayPersistencePort as s, type OverlayRawData as t, type OverlayRegistry as u, type OverlayWindowOptions as v, type RouterPort as w, type StoredValue as x, type Unsubscribe as y, allOverlayMeta as z };
397
+ export { locationRouter as $, type AnyOverlayMeta as A, closeOverlay as B, type CloseOverlaysBoundToPagePayload as C, DEFAULT_INSTANCE_ID as D, type ErrorSinkPort as E, closeOverlaysBoundToPage as F, consoleErrorSink as G, consoleNotify as H, type InstanceKey as I, debugOff as J, type KeepAlive as K, type LinkHydrateContext as L, type MobilePresentation as M, type NotifyOptions as N, type OverlayState as O, type PruneStaleInstancesPayload as P, defaultWindowIdFor as Q, type RawOpenPayload as R, type SummonPorts as S, type ToggleOverlayPayload as T, type UnbiddenHomeRoute as U, getOverlayMeta as V, type WindowPreservation as W, getOverlayMetaByLinkKey as X, instanceKey as Y, isRegisteredOverlay as Z, listOpenInstanceKeys as _, type StateWithOverlays as a, openOverlay as a0, overlayIdsBoundToPage as a1, parseInstanceKey as a2, registerOverlayMeta as a3, resetOverlayRegistry as a4, resolvePorts as a5, selectIsOverlayOpen as a6, selectOpenInstances as a7, selectOverlay as a8, selectOverlayData as a9, subscribeToOverlayRegistry as aa, toggleOverlay as ab, type CreateSummonGateOptions as ac, SUMMON_INSTALLED_ACTION as ad, SUMMON_SLICE_KEYS as ae, type SummonAction as af, type SummonGate as ag, closeAllOverlays as ah, createSummonGate as ai, ensureSummonRuntime as aj, focusWindow as ak, installSummonCore as al, isSummonAction as am, isSummonInstalled as an, minimizeAll as ao, prefetchSummonRuntime as ap, pruneStaleInstances as aq, restoreAll as ar, restoreWindow as as, selectAnyOverlayTouched as at, selectWindowsHidden as au, subscribeSummonInstalled as av, toggleWindowsHidden as aw, type OverlayDefinitionMeta as b, type SummonCore as c, type CloseAllInstancesPayload as d, type CloseOverlayPayload as e, DEFAULT_PORTS as f, type DebugPort as g, type IdentityPort as h, type InstanceMode as i, type NotifyPort as j, type OpenInstanceView as k, type OpenOverlayPayload as l, type OverlayDataOf as m, type OverlayHostDispatch as n, type OverlayId as o, type OverlayInstance as p, type OverlayLinkSpec as q, type OverlayPersistencePort as r, type OverlayRawData as s, type OverlayWindowOptions as t, type RouterPort as u, type StoredValue as v, type Unsubscribe as w, allOverlayMeta as x, anonymousIdentity as y, closeAllInstancesOfOverlay as z };
@@ -1,3 +1,4 @@
1
+ import { OverlayHostTypes, OverlayRegistry } from '@ai-matrx/summon';
1
2
  import { Reducer, Middleware } from '@reduxjs/toolkit';
2
3
 
3
4
  /**
@@ -18,8 +19,7 @@ import { Reducer, Middleware } from '@reduxjs/toolkit';
18
19
  * `defineOverlay` emits nothing at runtime for this; the augmentation is the host's one-line
19
20
  * declaration per overlay (the converter writes it next to each definition).
20
21
  */
21
- interface OverlayRegistry {
22
- }
22
+
23
23
  /** Every registered overlay id; plain `string` until the host augments the registry. */
24
24
  type OverlayId = [keyof OverlayRegistry] extends [never] ? string : Extract<keyof OverlayRegistry, string>;
25
25
  /** The open-data type declared for an overlay id. */
@@ -96,8 +96,6 @@ interface OverlayWindowOptions {
96
96
  *
97
97
  * declare module "@ai-matrx/summon" { interface OverlayHostTypes { dispatch: AppDispatch } }
98
98
  */
99
- interface OverlayHostTypes {
100
- }
101
99
  type OverlayHostDispatch = OverlayHostTypes extends {
102
100
  dispatch: infer D;
103
101
  } ? D : (action: unknown) => unknown;
@@ -396,4 +394,4 @@ interface CreateSummonGateOptions {
396
394
  }
397
395
  declare function createSummonGate(options?: CreateSummonGateOptions): SummonGate;
398
396
 
399
- export { isRegisteredOverlay as $, type AnyOverlayMeta as A, anonymousIdentity as B, type CloseOverlaysBoundToPagePayload as C, DEFAULT_INSTANCE_ID as D, type ErrorSinkPort as E, closeAllInstancesOfOverlay as F, closeOverlay as G, closeOverlaysBoundToPage as H, type InstanceKey as I, consoleErrorSink as J, type KeepAlive as K, type LinkHydrateContext as L, type MobilePresentation as M, type NotifyOptions as N, type OverlayState as O, type PruneStaleInstancesPayload as P, consoleNotify as Q, type RawOpenPayload as R, type SummonPorts as S, type ToggleOverlayPayload as T, type UnbiddenHomeRoute as U, debugOff as V, type WindowPreservation as W, defaultWindowIdFor as X, getOverlayMeta as Y, getOverlayMetaByLinkKey as Z, instanceKey as _, type StateWithOverlays as a, listOpenInstanceKeys as a0, locationRouter as a1, openOverlay as a2, overlayIdsBoundToPage as a3, parseInstanceKey as a4, registerOverlayMeta as a5, resetOverlayRegistry as a6, resolvePorts as a7, selectIsOverlayOpen as a8, selectOpenInstances as a9, selectOverlay as aa, selectOverlayData as ab, subscribeToOverlayRegistry as ac, toggleOverlay as ad, type CreateSummonGateOptions as ae, SUMMON_INSTALLED_ACTION as af, SUMMON_SLICE_KEYS as ag, type SummonAction as ah, type SummonGate as ai, closeAllOverlays as aj, createSummonGate as ak, ensureSummonRuntime as al, focusWindow as am, installSummonCore as an, isSummonAction as ao, isSummonInstalled as ap, minimizeAll as aq, prefetchSummonRuntime as ar, pruneStaleInstances as as, restoreAll as at, restoreWindow as au, selectAnyOverlayTouched as av, selectWindowsHidden as aw, subscribeSummonInstalled as ax, toggleWindowsHidden as ay, type OverlayDefinitionMeta as b, type SummonCore as c, type CloseAllInstancesPayload as d, type CloseOverlayPayload as e, DEFAULT_PORTS as f, type DebugPort as g, type IdentityPort as h, type InstanceMode as i, type NotifyPort as j, type OpenInstanceView as k, type OpenOverlayPayload as l, type OverlayDataOf as m, type OverlayHostDispatch as n, type OverlayHostTypes as o, type OverlayId as p, type OverlayInstance as q, type OverlayLinkSpec as r, type OverlayPersistencePort as s, type OverlayRawData as t, type OverlayRegistry as u, type OverlayWindowOptions as v, type RouterPort as w, type StoredValue as x, type Unsubscribe as y, allOverlayMeta as z };
397
+ export { locationRouter as $, type AnyOverlayMeta as A, closeOverlay as B, type CloseOverlaysBoundToPagePayload as C, DEFAULT_INSTANCE_ID as D, type ErrorSinkPort as E, closeOverlaysBoundToPage as F, consoleErrorSink as G, consoleNotify as H, type InstanceKey as I, debugOff as J, type KeepAlive as K, type LinkHydrateContext as L, type MobilePresentation as M, type NotifyOptions as N, type OverlayState as O, type PruneStaleInstancesPayload as P, defaultWindowIdFor as Q, type RawOpenPayload as R, type SummonPorts as S, type ToggleOverlayPayload as T, type UnbiddenHomeRoute as U, getOverlayMeta as V, type WindowPreservation as W, getOverlayMetaByLinkKey as X, instanceKey as Y, isRegisteredOverlay as Z, listOpenInstanceKeys as _, type StateWithOverlays as a, openOverlay as a0, overlayIdsBoundToPage as a1, parseInstanceKey as a2, registerOverlayMeta as a3, resetOverlayRegistry as a4, resolvePorts as a5, selectIsOverlayOpen as a6, selectOpenInstances as a7, selectOverlay as a8, selectOverlayData as a9, subscribeToOverlayRegistry as aa, toggleOverlay as ab, type CreateSummonGateOptions as ac, SUMMON_INSTALLED_ACTION as ad, SUMMON_SLICE_KEYS as ae, type SummonAction as af, type SummonGate as ag, closeAllOverlays as ah, createSummonGate as ai, ensureSummonRuntime as aj, focusWindow as ak, installSummonCore as al, isSummonAction as am, isSummonInstalled as an, minimizeAll as ao, prefetchSummonRuntime as ap, pruneStaleInstances as aq, restoreAll as ar, restoreWindow as as, selectAnyOverlayTouched as at, selectWindowsHidden as au, subscribeSummonInstalled as av, toggleWindowsHidden as aw, type OverlayDefinitionMeta as b, type SummonCore as c, type CloseAllInstancesPayload as d, type CloseOverlayPayload as e, DEFAULT_PORTS as f, type DebugPort as g, type IdentityPort as h, type InstanceMode as i, type NotifyPort as j, type OpenInstanceView as k, type OpenOverlayPayload as l, type OverlayDataOf as m, type OverlayHostDispatch as n, type OverlayId as o, type OverlayInstance as p, type OverlayLinkSpec as q, type OverlayPersistencePort as r, type OverlayRawData as s, type OverlayWindowOptions as t, type RouterPort as u, type StoredValue as v, type Unsubscribe as w, allOverlayMeta as x, anonymousIdentity as y, closeAllInstancesOfOverlay as z };