@opsydyn/astro-foldkit 0.7.2 → 0.8.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/CHANGELOG.md CHANGED
@@ -1,11 +1,26 @@
1
1
  # Changelog
2
2
 
3
- ## [0.7.2](https://github.com/opsydyn/fold-kit-experiments/compare/astro-foldkit-v0.7.1...astro-foldkit-v0.7.2) (2026-10-05)
3
+ ## [0.8.0](https://github.com/opsydyn/fold-kit-experiments/compare/astro-foldkit-v0.7.2...astro-foldkit-v0.8.0) (2026-10-09)
4
+
5
+ Upgrade FoldKit alongside this package: the supported peer range is now
6
+ `>=0.167.0 <0.168.0`, with Effect `4.0.0`. Public app and server APIs are unchanged.
7
+ The integration uses `@foldkit/vite-plugin` 0.27.x for coordinated client/server
8
+ build identity. See the [migration guide](https://github.com/opsydyn/fold-kit-experiments/blob/main/docs/migrations/foldkit-0.167.md)
9
+ and [release notes](https://github.com/opsydyn/fold-kit-experiments/blob/main/docs/releases/foldkit-0.167.md).
10
+
11
+ ### Features
12
+
13
+ - support FoldKit 0.167 and keyed chart comparison ([6e3edf7](https://github.com/opsydyn/fold-kit-experiments/commit/6e3edf76d0e04047652c052e2254ccd67a2458d9))
4
14
 
15
+ ### Bug Fixes
16
+
17
+ - **deps:** patch Astro to 7.2.8 ([65ebdb7](https://github.com/opsydyn/fold-kit-experiments/commit/65ebdb74999e7bcafb127f3c87e424dc165a3a7d))
18
+
19
+ ## [0.7.2](https://github.com/opsydyn/fold-kit-experiments/compare/astro-foldkit-v0.7.1...astro-foldkit-v0.7.2) (2026-10-05)
5
20
 
6
21
  ### Bug Fixes
7
22
 
8
- * support FoldKit 0.166.0 ([248636e](https://github.com/opsydyn/fold-kit-experiments/commit/248636efea03a2048432260da6261bb657a282dc))
23
+ - support FoldKit 0.166.0 ([248636e](https://github.com/opsydyn/fold-kit-experiments/commit/248636efea03a2048432260da6261bb657a282dc))
9
24
 
10
25
  ## [0.7.1](https://github.com/opsydyn/fold-kit-experiments/compare/astro-foldkit-v0.7.0...astro-foldkit-v0.7.1) (2026-10-04)
11
26
 
package/README.md CHANGED
@@ -20,8 +20,8 @@ npm install astro foldkit
20
20
 
21
21
  ## FoldKit compatibility
22
22
 
23
- `@opsydyn/astro-foldkit` is tested with FoldKit `0.165.x`, stable Effect
24
- `4.0.0`, and the matching `@foldkit/vite-plugin` `0.26.x` line.
23
+ `@opsydyn/astro-foldkit` targets FoldKit `0.167.x`, stable Effect
24
+ `4.0.0`, and the matching `@foldkit/vite-plugin` `0.27.x` line.
25
25
  Applications can define interruptible work with
26
26
  `Command.define(name, { interrupt: true, ... })` inside their own update loop;
27
27
  this integration continues to own Astro rendering, hydration, and lifecycle
@@ -36,21 +36,25 @@ import { defineConfig } from 'astro/config';
36
36
  import foldkit from '@opsydyn/astro-foldkit';
37
37
 
38
38
  export default defineConfig({
39
- integrations: [
40
- foldkit({
41
- server: {
42
- buildId: process.env.FOLDKIT_BUILD_ID ?? 'development',
43
- },
44
- }),
45
- ],
39
+ integrations: [foldkit()],
46
40
  });
47
41
  ```
48
42
 
49
- The build ID is an explicit server/client handoff identity. Use a stable
50
- deployment-specific value in production and the same value in every process
51
- that serves the build. The integration defaults to `development` for local
52
- use, rejects a blank value, and fails a `definePage` render closed rather than
53
- hydrating a mismatched document when no usable identity is available.
43
+ FoldKit generates one public build identity for the coordinated client and server
44
+ artifacts. The integration uses that compiled identity by default, including
45
+ Astro's prerender and Cloudflare environments. Astro continues to own the HTML
46
+ document, assets, and deployment adapter; do not enable the standalone FoldKit
47
+ `ssr.build` pipeline inside this integration.
48
+
49
+ For separately built artifacts, supply the same deployment-specific
50
+ `FOLDKIT_BUILD_ID` environment variable to every build, or configure
51
+ `foldkit({ server: { buildId: 'release-unique-deployment-id' } })`. The ID appears
52
+ in public HTML, so it must not contain secrets. Do not reuse it across deployments
53
+ with different rendering inputs. Blank `server.buildId` options are rejected, and FoldKit
54
+ fails closed when neither a compiled identity nor an explicit override is available.
55
+
56
+ See the [0.167 migration guide](../../docs/migrations/foldkit-0.167.md) for the
57
+ subscription API changes and package compatibility checks.
54
58
 
55
59
  ## Defining an app
56
60
 
@@ -97,6 +101,13 @@ serialisation and client directive behavior.
97
101
 
98
102
  The demo app's [`/request-diagnostics`](../../apps/web/src/pages/request-diagnostics.astro) page shows the integration boundary with a practical machine-driven chart workflow. The page uses `@opsydyn/astro-foldkit` for hydration, `@opsydyn/foldkit-viz` for chart primitives, and `foldkit/experimental/machine` in the application update layer.
99
103
 
104
+ The [`/comparison`](../../apps/web/src/pages/comparison.astro) example hosts
105
+ dynamic scatter/histogram panels using the same `lazyApp` island contract.
106
+ Stable panel IDs, `foldChildAt`, linked selection, measurements and focus policy
107
+ belong to the application. Astro provides hydration and lifecycle facts only;
108
+ no additional integration API or server-rendering opt-in is required. The promo
109
+ hosts the maintained workbench with source inspection and standalone exports.
110
+
100
111
  ## Server-rendered pages (opt-in)
101
112
 
102
113
  Use `definePage` when one FoldKit application owns the document content for an
@@ -486,7 +497,7 @@ element.addEventListener(
486
497
  | Package | Version |
487
498
  | :-------- | :-------------------- |
488
499
  | `astro` | `≥ 5.0` |
489
- | `foldkit` | `≥ 0.165.0 < 0.167.0` |
500
+ | `foldkit` | `≥ 0.167.0 < 0.168.0` |
490
501
 
491
502
  ## Stateflow Observatory example
492
503
 
@@ -499,7 +510,7 @@ replay policy, and trace inspector. The graph consumes plain layout records.
499
510
  This slice adds no Astro integration API and moves no async work into the
500
511
  integration. Commands and subscriptions remain app-owned, including telemetry
501
512
  emission, validation of inbound replay events, and the reduced-motion
502
- `Subscription.fromMediaQuery` subscription. That subscription is the app's
513
+ `Dom.streamFromMediaQuery` stream in a `Subscription.persistentEntry`. That subscription is the app's
503
514
  example of FoldKit PR [#1424](https://github.com/foldkit/foldkit/pull/1424): it
504
515
  records the browser's initial media-query match and subsequent changes, then
505
516
  lets the Model decide whether visual motion is allowed.
@@ -2,6 +2,6 @@
2
2
  type FoldkitEnv = Readonly<{
3
3
  FOLDKIT_BUILD_ID?: string;
4
4
  }>;
5
- declare function readFoldkitBuildId(env?: FoldkitEnv | undefined): string;
5
+ declare function readFoldkitBuildId(env?: FoldkitEnv | undefined): string | undefined;
6
6
  //#endregion
7
7
  export { readFoldkitBuildId };
package/dist/build-id.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region src/build-id.ts
2
2
  function readFoldkitBuildId(env = import.meta.env) {
3
3
  const buildId = env?.FOLDKIT_BUILD_ID;
4
- if (buildId === void 0 || buildId === "") throw new Error("FoldKit server rendering requires import.meta.env.FOLDKIT_BUILD_ID. Configure foldkit({ server: { buildId } }).");
4
+ if (buildId !== void 0 && buildId.trim() === "") throw new Error("FOLDKIT_BUILD_ID must be non-empty when configured. Omit it to use the generated build identity.");
5
5
  return buildId;
6
6
  }
7
7
  //#endregion
package/dist/client.d.mts CHANGED
@@ -5,7 +5,7 @@ import { a as FoldkitApp, n as AppConfigContract } from "./types-DDk3MMb7.mjs";
5
5
  interface RuntimeConfigInput {}
6
6
  interface RuntimeProgram {}
7
7
  interface RuntimeHydrationOptions {
8
- readonly buildId: string;
8
+ readonly buildId?: string;
9
9
  }
10
10
  interface ClientSlots {}
11
11
  type EventTargetLike = {
package/dist/index.mjs CHANGED
@@ -4,7 +4,6 @@ import { foldkit as foldkit$1 } from "@foldkit/vite-plugin";
4
4
  function foldkit(options = {}) {
5
5
  const configuredBuildId = options.server?.buildId;
6
6
  if (configuredBuildId !== void 0 && configuredBuildId.trim() === "") throw new Error("foldkit({ server: { buildId } }) requires a non-empty server.buildId.");
7
- const buildId = configuredBuildId ?? "development";
8
7
  return {
9
8
  name: "astro-foldkit",
10
9
  hooks: { "astro:config:setup": ({ addRenderer, updateConfig }) => {
@@ -13,7 +12,7 @@ function foldkit(options = {}) {
13
12
  clientEntrypoint: fileURLToPath(new URL("./client.mjs", import.meta.url)),
14
13
  serverEntrypoint: fileURLToPath(new URL("./server.mjs", import.meta.url))
15
14
  });
16
- updateConfig({ vite: { plugins: [foldkit$1({ buildId })] } });
15
+ updateConfig({ vite: { plugins: [foldkit$1(options.server)] } });
17
16
  } }
18
17
  };
19
18
  }
@@ -3,6 +3,6 @@ import { RenderedApplication } from "foldkit/experimental/server";
3
3
 
4
4
  //#region src/server-render.d.ts
5
5
  type ServerConfig<Flags extends object> = Pick<PageConfigContract<Flags>, 'Flags' | 'init' | 'view'>;
6
- declare function renderFoldkitServerApplication<Flags extends object>(config: ServerConfig<Flags>, flags: Flags, buildId: string): Promise<RenderedApplication>;
6
+ declare function renderFoldkitServerApplication<Flags extends object>(config: ServerConfig<Flags>, flags: Flags, buildId?: string): Promise<RenderedApplication>;
7
7
  //#endregion
8
8
  export { renderFoldkitServerApplication };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opsydyn/astro-foldkit",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "Astro integration and renderer for FoldKit.",
5
5
  "keywords": [
6
6
  "astro",
@@ -72,21 +72,21 @@
72
72
  "check:fix": "oxfmt . && NODE_OPTIONS=\"--experimental-strip-types\" oxlint --fix ."
73
73
  },
74
74
  "dependencies": {
75
- "@foldkit/vite-plugin": "^0.26.1",
75
+ "@foldkit/vite-plugin": "^0.27.0",
76
76
  "effect": "4.0.0"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@types/node": "^22.0.0",
80
- "astro": "7.1.1",
80
+ "astro": "7.2.8",
81
81
  "bun-types": "^1.3.14",
82
82
  "fast-check": "^4.8.0",
83
- "foldkit": "0.166.0",
83
+ "foldkit": "0.167.0",
84
84
  "tsdown": "^0.21.8",
85
85
  "typescript": "^6.0.3"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "astro": ">=5.0.0",
89
- "foldkit": ">=0.165.0 <0.167.0"
89
+ "foldkit": ">=0.167.0 <0.168.0"
90
90
  },
91
91
  "engines": {
92
92
  "node": ">=22.0.0"