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
29 changes: 0 additions & 29 deletions .changeset/fix-popstate-run-on-app-runtime.md

This file was deleted.

7 changes: 7 additions & 0 deletions apps/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# docs

## 0.0.29

### Patch Changes

- Updated dependencies [6651e7e]
- @effex/router@1.3.6

## 0.0.28

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.28",
"version": "0.0.29",
"private": true,
"type": "module",
"scripts": {
Expand Down
29 changes: 29 additions & 0 deletions packages/router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@effex/router",
"version": "1.3.5",
"version": "1.3.6",
"description": "Router for Effex applications",
"type": "module",
"license": "MIT",
Expand Down
Loading