From ddf398202da6b3d150b25aca6da16e69e0989fc6 Mon Sep 17 00:00:00 2001 From: ENvironmentSet Date: Tue, 21 Jul 2026 20:47:19 +0900 Subject: [PATCH 1/2] feat(plugin-stack-persistence): pass stack to createMetadata (FEP-2609) --- .../plugin-stack-persistence/src/StackSnapshotStrategy.ts | 6 ++---- .../plugin-stack-persistence/src/stackPersistencePlugin.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/extensions/plugin-stack-persistence/src/StackSnapshotStrategy.ts b/extensions/plugin-stack-persistence/src/StackSnapshotStrategy.ts index 7348b6486..ea14e4ff6 100644 --- a/extensions/plugin-stack-persistence/src/StackSnapshotStrategy.ts +++ b/extensions/plugin-stack-persistence/src/StackSnapshotStrategy.ts @@ -1,10 +1,8 @@ -import type { StackSnapshot } from "@stackflow/core"; +import type { Stack, StackSnapshot } from "@stackflow/core"; import type { StackSnapshotRecord } from "./StackSnapshotRecord"; export interface StackSnapshotStrategy { - createMetadata(args: { - snapshot: StackSnapshot; - }): Metadata; + createMetadata(args: { stack: Stack; snapshot: StackSnapshot }): Metadata; shouldReuse(args: { record: StackSnapshotRecord; diff --git a/extensions/plugin-stack-persistence/src/stackPersistencePlugin.ts b/extensions/plugin-stack-persistence/src/stackPersistencePlugin.ts index 10955067e..ff10cab8f 100644 --- a/extensions/plugin-stack-persistence/src/stackPersistencePlugin.ts +++ b/extensions/plugin-stack-persistence/src/stackPersistencePlugin.ts @@ -24,7 +24,7 @@ export function stackPersistencePlugin( if (stack.globalTransitionState !== "idle") return; const snapshot = actions.captureSnapshot(); - const metadata = strategy.createMetadata({ snapshot }); + const metadata = strategy.createMetadata({ stack, snapshot }); storage.save({ snapshot, From 015eb802747db07b1b6e7a85b106d3852eecb22f Mon Sep 17 00:00:00 2001 From: ENvironmentSet Date: Tue, 21 Jul 2026 20:55:12 +0900 Subject: [PATCH 2/2] chore: add changeset for FEP-2609 Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01FFhwNMAYBFo7v4aQR1vqvk --- .changeset/fep-2609-create-metadata-stack.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fep-2609-create-metadata-stack.md diff --git a/.changeset/fep-2609-create-metadata-stack.md b/.changeset/fep-2609-create-metadata-stack.md new file mode 100644 index 000000000..1a2cdb142 --- /dev/null +++ b/.changeset/fep-2609-create-metadata-stack.md @@ -0,0 +1,5 @@ +--- +"@stackflow/plugin-stack-persistence": minor +--- + +Pass the current `Stack` to `StackSnapshotStrategy.createMetadata`, so metadata can be derived from the same stack state that the snapshot is captured from.