diff --git a/.changeset/fix-popstate-run-on-app-runtime.md b/.changeset/fix-popstate-run-on-app-runtime.md deleted file mode 100644 index 40a89c7..0000000 --- a/.changeset/fix-popstate-run-on-app-runtime.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -"@effex/router": patch ---- - -Fix browser back/forward buttons not triggering re-renders under SSG -dev mode (and any client-side navigation scenario that relies on -`popstate`). - -The `popstate` handler ran the pathname signal update via -`Effect.runSync`. `Signal.set` internally uses `SubscriptionRef.set`, -which acquires a semaphore permit — Effect flags that as async-capable, -so `Effect.runSync` bails silently. The event handler swallows the -throw (browsers don't reliably surface exceptions from raw event -listeners to `console.error`), so the signal never actually updates, -`Outlet`'s subscribers never see the change, and the page appears -frozen on the previous route while the URL bar shows the new one. - -Fix: capture the Runtime at Layer construction time and use -`Runtime.runFork` to schedule the update. `runFork` accepts async work -and runs it on the same Runtime the rest of the app uses, so the -signal update reliably reaches subscribers even when the underlying -`Signal.set` isn't purely synchronous. - -Regression tests cover: - -- Pathname signal updates on popstate. -- Subscribers to `pathname.changes` (Outlet's shape) receive the - popstate-driven change. -- The handler doesn't throw or fail silently. diff --git a/apps/docs/CHANGELOG.md b/apps/docs/CHANGELOG.md index e1c3f32..ed79913 100644 --- a/apps/docs/CHANGELOG.md +++ b/apps/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # docs +## 0.0.29 + +### Patch Changes + +- Updated dependencies [6651e7e] + - @effex/router@1.3.6 + ## 0.0.28 ### Patch Changes diff --git a/apps/docs/package.json b/apps/docs/package.json index 99c67e6..1337122 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.0.28", + "version": "0.0.29", "private": true, "type": "module", "scripts": { diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index 86c6263..d24daee 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -1,5 +1,34 @@ # @effex/router +## 1.3.6 + +### Patch Changes + +- 6651e7e: Fix browser back/forward buttons not triggering re-renders under SSG + dev mode (and any client-side navigation scenario that relies on + `popstate`). + + The `popstate` handler ran the pathname signal update via + `Effect.runSync`. `Signal.set` internally uses `SubscriptionRef.set`, + which acquires a semaphore permit — Effect flags that as async-capable, + so `Effect.runSync` bails silently. The event handler swallows the + throw (browsers don't reliably surface exceptions from raw event + listeners to `console.error`), so the signal never actually updates, + `Outlet`'s subscribers never see the change, and the page appears + frozen on the previous route while the URL bar shows the new one. + + Fix: capture the Runtime at Layer construction time and use + `Runtime.runFork` to schedule the update. `runFork` accepts async work + and runs it on the same Runtime the rest of the app uses, so the + signal update reliably reaches subscribers even when the underlying + `Signal.set` isn't purely synchronous. + + Regression tests cover: + - Pathname signal updates on popstate. + - Subscribers to `pathname.changes` (Outlet's shape) receive the + popstate-driven change. + - The handler doesn't throw or fail silently. + ## 1.3.5 ### Patch Changes diff --git a/packages/router/package.json b/packages/router/package.json index 471ba4e..5e923b6 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@effex/router", - "version": "1.3.5", + "version": "1.3.6", "description": "Router for Effex applications", "type": "module", "license": "MIT",