@async/framework 0.5.0 → 0.6.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@async/framework",
3
- "version": "0.5.0",
4
- "description": "No-build AsyncLoader app runtime with signals, command events, server calls, route partials, cache split, SSR activation, and streaming boundaries.",
3
+ "version": "0.6.0",
4
+ "description": "No-build Loader app runtime with signals, command events, server calls, route partials, cache split, SSR activation, and streaming boundaries.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.1.0",
7
7
  "engines": {
@@ -28,21 +28,49 @@
28
28
  "web-framework"
29
29
  ],
30
30
  "license": "MIT",
31
- "unpkg": "./framework.js",
31
+ "types": "./framework.d.ts",
32
+ "unpkg": "./framework.umd.min.js",
33
+ "jsdelivr": "./framework.umd.min.js",
32
34
  "exports": {
33
35
  ".": {
34
- "unpkg": "./framework.js",
36
+ "types": "./framework.d.ts",
37
+ "unpkg": "./framework.umd.min.js",
35
38
  "browser": "./framework.js",
36
39
  "import": "./src/index.js",
37
40
  "default": "./src/index.js"
38
41
  },
39
- "./framework.js": "./framework.js",
42
+ "./framework.js": {
43
+ "types": "./framework.d.ts",
44
+ "default": "./framework.js"
45
+ },
46
+ "./framework.min.js": {
47
+ "types": "./framework.d.ts",
48
+ "default": "./framework.min.js"
49
+ },
50
+ "./framework.umd.js": {
51
+ "types": "./framework.d.ts",
52
+ "default": "./framework.umd.js"
53
+ },
54
+ "./framework.umd.min.js": {
55
+ "types": "./framework.d.ts",
56
+ "default": "./framework.umd.min.js"
57
+ },
58
+ "./framework.ts": {
59
+ "types": "./framework.d.ts",
60
+ "default": "./framework.ts"
61
+ },
62
+ "./framework.d.ts": "./framework.d.ts",
40
63
  "./package.json": "./package.json"
41
64
  },
42
65
  "files": [
43
66
  "CHANGELOG.md",
44
67
  "README.md",
68
+ "framework.d.ts",
45
69
  "framework.js",
70
+ "framework.min.js",
71
+ "framework.umd.js",
72
+ "framework.umd.min.js",
73
+ "framework.ts",
46
74
  "src",
47
75
  "examples",
48
76
  "LICENSE",
@@ -68,6 +96,7 @@
68
96
  "pipeline:sync:generate": "async-pipeline sync generate",
69
97
  "pipeline:task:docs.site": "async-pipeline run-task docs.site",
70
98
  "pipeline:verify": "async-pipeline run verify",
99
+ "registry:lint": "node scripts/registry-lint.js",
71
100
  "release:check": "pnpm run pipeline:verify -- --force && pnpm run pipeline:pages -- --force && pnpm run pipeline:sync:check && pnpm run pipeline:github:check",
72
101
  "test": "node --test tests/*.test.js"
73
102
  },
package/src/app.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createCacheRegistry } from "./cache.js";
2
2
  import { createComponentRegistry } from "./component.js";
3
3
  import { createHandlerRegistry } from "./handlers.js";
4
- import { AsyncLoader } from "./loader.js";
4
+ import { Loader } from "./loader.js";
5
5
  import { createPartialRegistry } from "./partials.js";
6
6
  import { createRouteRegistry, createRouter } from "./router.js";
7
7
  import { createServerRegistry } from "./server.js";
@@ -101,7 +101,7 @@ export function createApp(appOrDefinition = Async, options = {}) {
101
101
  started = true;
102
102
 
103
103
  if (target !== "server") {
104
- loader = loader ?? AsyncLoader({
104
+ loader = loader ?? Loader({
105
105
  root: options.root,
106
106
  signals,
107
107
  handlers,
package/src/component.js CHANGED
@@ -89,7 +89,7 @@ export function renderComponent(Component, props = {}, runtime, parentScope = "c
89
89
  bind(value) {
90
90
  const id = runtime.loader?._registerBinding?.(value);
91
91
  if (!id) {
92
- throw new Error("Inline template bindings require an AsyncLoader.");
92
+ throw new Error("Inline template bindings require a Loader.");
93
93
  }
94
94
  bindingIds.push(id);
95
95
  return id;
package/src/index.js CHANGED
@@ -6,7 +6,7 @@ export { component, createComponentRegistry, defineComponent } from "./component
6
6
  export { delay } from "./delay.js";
7
7
  export { createHandlerRegistry } from "./handlers.js";
8
8
  export { html } from "./html.js";
9
- export { AsyncLoader } from "./loader.js";
9
+ export { Loader, AsyncLoader } from "./loader.js";
10
10
  export { createPartialRegistry } from "./partials.js";
11
11
  export { createRegistryStore } from "./registry-store.js";
12
12
  export { createRouteRegistry, createRouter, defineRoute, route } from "./router.js";
package/src/loader.js CHANGED
@@ -5,7 +5,7 @@ import { matchAttribute, normalizeAttributeConfig, readAttribute } from "./attri
5
5
 
6
6
  const inlineBindingPrefix = "__async:inline:";
7
7
 
8
- export function AsyncLoader({ root, signals, handlers, server, router, cache, attributes } = {}) {
8
+ export function Loader({ root, signals, handlers, server, router, cache, attributes } = {}) {
9
9
  const documentRef = root?.ownerDocument ?? root ?? globalThis.document;
10
10
  const rootNode = root ?? documentRef;
11
11
  const signalRegistry = signals ?? createSignalRegistry();
@@ -447,7 +447,7 @@ export function AsyncLoader({ root, signals, handlers, server, router, cache, at
447
447
 
448
448
  function assertActive() {
449
449
  if (destroyed) {
450
- throw new Error("AsyncLoader has been destroyed.");
450
+ throw new Error("Loader has been destroyed.");
451
451
  }
452
452
  }
453
453
 
@@ -511,6 +511,8 @@ export function AsyncLoader({ root, signals, handlers, server, router, cache, at
511
511
  return api;
512
512
  }
513
513
 
514
+ export const AsyncLoader = Loader;
515
+
514
516
  function normalizeClassTokens(value, tokens = new Set()) {
515
517
  if (value == null || value === false) {
516
518
  return tokens;
package/src/router.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AsyncLoader } from "./loader.js";
1
+ import { Loader } from "./loader.js";
2
2
  import { createHandlerRegistry } from "./handlers.js";
3
3
  import { createSignalRegistry } from "./signals.js";
4
4
  import { applyServerResult } from "./server.js";
@@ -128,7 +128,7 @@ export function createRouter({
128
128
  const attributeConfig = normalizeAttributeConfig(attributes ?? loader?.attributes);
129
129
  const loaderInstance =
130
130
  loader ??
131
- AsyncLoader({
131
+ Loader({
132
132
  root: rootNode,
133
133
  signals: signalRegistry,
134
134
  handlers: handlerRegistry,