@async/framework 0.11.16 → 0.11.18

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,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.18 - 2026-06-19
4
+
5
+ - Added inert build optimizer artifact helpers for ADR 26 pass records,
6
+ diagnostics, runtime slice selection, handler emission, and development
7
+ report generation.
8
+ - Added optimizer fixtures for signal source classification, signal ownership,
9
+ JSX event symbol extraction, Suspense/Reveal lowering, runtime selection, and
10
+ server-only browser import diagnostics.
11
+ - Added build optimizer tests proving maybe-promise signals fail explicitly,
12
+ event handlers are not forced through dynamic imports, Reveal ordering is
13
+ deterministic, omitted runtime systems are visible, and helpers do not execute
14
+ app modules or import no-build runtime systems.
15
+ - Bundle size from bundled TypeScript source: `browser.ts` raw 221,403 B (221.4 KB / 0.221 MB), gzip 42,093 B (42.1 KB / 0.042 MB), br 34,797 B (34.8 KB / 0.035 MB) -> `browser.min.js` raw 95,027 B (95.0 KB / 0.095 MB), gzip 28,145 B (28.1 KB / 0.028 MB), br 24,793 B (24.8 KB / 0.025 MB); delta raw -126,376 B (-126.4 KB / -0.126 MB), gzip -13,948 B (-13.9 KB / -0.014 MB), br -10,004 B (-10.0 KB / -0.010 MB).
16
+
17
+ ## 0.11.17 - 2026-06-19
18
+
19
+ - Added the stream backpatch protocol to `createBoundaryReceiver(...)` with
20
+ strict `attrs` validation for built numeric triples and no-build named
21
+ tuples.
22
+ - Added pending-slot replacement and reveal coordination for `as-ready`,
23
+ `forwards`, `backwards`, and `together` stream groups, including collapsed
24
+ and hidden tail visibility handling.
25
+ - Added the `AsyncStream` browser helper for no-build JSON stream patches,
26
+ template replacement, configured `data-async-*` attributes, and direct-child
27
+ reveal metadata synthesis.
28
+ - Added stream backpatch scenario-size coverage and updated browser scenario
29
+ budgets for the expanded public stream surface.
30
+ - Bundle size from bundled TypeScript source: `browser.ts` raw 221,403 B (221.4 KB / 0.221 MB), gzip 42,093 B (42.1 KB / 0.042 MB), br 34,797 B (34.8 KB / 0.035 MB) -> `browser.min.js` raw 95,027 B (95.0 KB / 0.095 MB), gzip 28,145 B (28.1 KB / 0.028 MB), br 24,793 B (24.8 KB / 0.025 MB); delta raw -126,376 B (-126.4 KB / -0.126 MB), gzip -13,948 B (-13.9 KB / -0.014 MB), br -10,004 B (-10.0 KB / -0.010 MB).
31
+
3
32
  ## 0.11.16 - 2026-06-19
4
33
 
5
34
  - Added runtime slice entrypoints for `@async/framework/runtime`,
package/browser.d.ts CHANGED
@@ -513,10 +513,30 @@ export interface LoaderInstance {
513
513
  export type AsyncLoaderOptions = LoaderOptions;
514
514
  export type AsyncLoaderInstance = LoaderInstance;
515
515
 
516
+ export type AttributePatchValue = string | number | boolean | null | undefined;
517
+ export type BuiltAttributePatchTriples = readonly AttributePatchValue[];
518
+ export type NoBuildAttributePatchTuple = readonly [targetName: string, attrName: string, value: AttributePatchValue];
519
+ export type NoBuildAttributePatchTuples = readonly NoBuildAttributePatchTuple[];
520
+ export interface StreamReplacement {
521
+ target: string;
522
+ html?: TemplateLike;
523
+ template?: string;
524
+ mode?: "pending" | "boundary";
525
+ }
526
+ export interface StreamRevealMetadata {
527
+ group: string;
528
+ index: number;
529
+ count: number;
530
+ order?: "as-ready" | "forwards" | "backwards" | "together";
531
+ tail?: "collapsed" | "hidden";
532
+ }
516
533
  export interface BoundaryPatch {
517
534
  boundary: string;
518
535
  seq: number;
519
536
  html?: TemplateLike;
537
+ replace?: StreamReplacement | readonly StreamReplacement[];
538
+ attrs?: BuiltAttributePatchTriples | NoBuildAttributePatchTuples;
539
+ reveal?: StreamRevealMetadata;
520
540
  signals?: Record<string, unknown>;
521
541
  cache?: { browser?: Record<string, unknown> };
522
542
  redirect?: string;
@@ -526,17 +546,24 @@ export interface BoundaryPatch {
526
546
  meta?: Record<string, unknown>;
527
547
  }
528
548
 
549
+ export interface BoundaryPatchCounts {
550
+ applied: number;
551
+ ignored?: number;
552
+ }
553
+
529
554
  export type BoundaryApplyResult =
530
- | { status: "applied"; boundary: string; seq: number }
555
+ | { status: "applied"; boundary: string; seq: number; attrs?: BoundaryPatchCounts; replace?: BoundaryPatchCounts }
556
+ | { status: "buffered"; boundary: string; seq: number; reveal: Required<Pick<StreamRevealMetadata, "group" | "index" | "count">> & Pick<StreamRevealMetadata, "order" | "tail"> }
531
557
  | { status: "ignored-stale"; boundary: string; seq: number; lastSeq: number }
532
558
  | { status: "ignored-destroyed"; boundary: string; seq: number; parentScope?: string }
533
- | { status: "redirected"; boundary: string; seq: number; redirect: string }
559
+ | { status: "redirected"; boundary: string; seq: number; redirect: string; attrs?: BoundaryPatchCounts; replace?: BoundaryPatchCounts }
534
560
  | { status: "errored"; boundary: string; seq: number; error: Error };
535
561
 
536
562
  export interface BoundaryReceiverInspection {
537
563
  destroyed: boolean;
538
564
  boundaries: Record<string, { lastSeq: number; applied: number; ignored: number; errored?: number; lastStatus?: BoundaryApplyResult["status"] }>;
539
- recent: Array<{ boundary: string; seq: number; status: BoundaryApplyResult["status"]; lastSeq?: number; parentScope?: string; redirect?: string }>;
565
+ reveal: Record<string, { count: number; order: string; tail?: string; pending: number[]; committed: number[] }>;
566
+ recent: Array<{ boundary: string; seq: number; status: BoundaryApplyResult["status"]; lastSeq?: number; parentScope?: string; redirect?: string; attrs?: BoundaryPatchCounts; replace?: BoundaryPatchCounts; reveal?: StreamRevealMetadata }>;
540
567
  }
541
568
 
542
569
  export interface BoundaryReceiverOptions {
@@ -545,6 +572,7 @@ export interface BoundaryReceiverOptions {
545
572
  cache?: CacheRegistry;
546
573
  scheduler?: Scheduler;
547
574
  router?: Router;
575
+ attributes?: AttributeConfig;
548
576
  onApply?(result: BoundaryApplyResult, patch: BoundaryPatch): void;
549
577
  onIgnore?(result: BoundaryApplyResult, patch: BoundaryPatch): void;
550
578
  onError?(error: Error, result: BoundaryApplyResult, patch: BoundaryPatch): void;
@@ -560,6 +588,18 @@ export interface BoundaryReceiver {
560
588
  destroy(): void;
561
589
  }
562
590
 
591
+ export interface AsyncStreamApplyOptions extends Partial<BoundaryReceiverOptions> {
592
+ receiver?: BoundaryReceiver;
593
+ runtime?: AppRuntime;
594
+ root?: Document | Element | DocumentFragment;
595
+ }
596
+
597
+ export interface AsyncStreamNamespace {
598
+ applyScript(script: Element, options?: AsyncStreamApplyOptions): Promise<BoundaryApplyResult>;
599
+ applyCurrentScript(script?: Element, options?: AsyncStreamApplyOptions): Promise<BoundaryApplyResult>;
600
+ applyCurrentScript(options?: AsyncStreamApplyOptions): Promise<BoundaryApplyResult>;
601
+ }
602
+
563
603
  export interface RegistryStore {
564
604
  target: RuntimeTarget;
565
605
  register(type: RegistryType, id: string, value: unknown): string;
@@ -696,6 +736,7 @@ export interface AsyncNamespace extends AppHub {
696
736
  inspectRoots: AppHub["inspectRoots"];
697
737
  attributeName: typeof attributeName;
698
738
  defineAttributeConfig: typeof defineAttributeConfig;
739
+ AsyncStream: AsyncStreamNamespace;
699
740
  createBoundaryReceiver: typeof createBoundaryReceiver;
700
741
  createCacheRegistry: typeof createCacheRegistry;
701
742
  defineCache: typeof defineCache;
@@ -736,6 +777,7 @@ export declare function defineApp(initial?: AppDefinition): AppHub;
736
777
  export declare function readSnapshot(root?: Document | Element, options?: { attributes?: AttributeConfig }): RegistryRuntimeSnapshot;
737
778
  export declare function attributeName(attributes: AttributeConfig | undefined, type: keyof NormalizedAttributeConfig, name: string): string;
738
779
  export declare function defineAttributeConfig(config?: AttributeConfig): NormalizedAttributeConfig;
780
+ export declare const AsyncStream: AsyncStreamNamespace;
739
781
  export declare function createBoundaryReceiver(options: BoundaryReceiverOptions): BoundaryReceiver;
740
782
  export declare function createCacheRegistry(initialMap?: Record<string, CacheDefinition | CacheDefinitionOptions>, options?: { now?: () => number; registry?: RegistryStore; type?: "cache.browser" | "cache.server" }): CacheRegistry;
741
783
  export declare function defineCache(options?: CacheDefinitionOptions): CacheDefinition;