Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/blocker-replay-marker-serializable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stackflow/plugin-blocker": patch
---

Use a namespaced string key instead of a `Symbol` for the internal replay marker. A `Symbol`-keyed property leaked into the recorded event log, so a captured `StackSnapshot` containing a blocked-then-proceeded navigation could not be serialized by codecs that reject symbol keys (e.g. `devalue` throws `Cannot stringify POJOs with symbolic keys`). The marker is now a plain, serializable key.
6 changes: 3 additions & 3 deletions extensions/plugin-blocker/src/blockerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function useBlockerStore(): BlockerStore {
}

function replayAction(
replayMarker: symbol,
replayMarker: string,
store: BlockerStore,
action: NavigationAction,
) {
Expand Down Expand Up @@ -92,7 +92,7 @@ function replayAction(
}

function handleBeforeNavigation(
replayMarker: symbol,
replayMarker: string,
store: BlockerStore,
action: NavigationAction,
preventDefault: () => void,
Expand Down Expand Up @@ -164,7 +164,7 @@ function handleBeforeNavigation(
export function blockerPlugin(options?: {
onError?: (error: unknown) => void;
}): StackflowReactPlugin {
const replayMarker = Symbol("@@blockerReplay");
const replayMarker = "@stackflow/plugin-blocker/replay";

const store: BlockerStore = {
blockers: new Map(),
Expand Down
Loading