Skip to content

0.1.0-alpha.8: server sessions in Effect and fetch, rewritten JSDoc - #9

Merged
monarcode merged 15 commits into
mainfrom
0.1.0-alpha.8
Nov 12, 2026
Merged

monarcode merged 15 commits into
mainfrom
0.1.0-alpha.8

Conversation

@monarcode

@monarcode monarcode commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Release 0.1.0-alpha.8. App code written against a client (createAuthFetch, Auth.layer, effetch's sessionBearer) now runs on the server against one request's cookie session. The JSDoc on every entry point is rewritten for app developers.

Added

  • serverAuth.forRequest(jar) (/server) returns RequestAuth, one request's session with a client's read side: getSession, signOut, credentials, isCurrent and state. With it, createAuthFetch sends the cookie's token and saves a renewed one after a 401.
    • A read-only jar can't renew. There, a 401 rejects with REFRESH_FAILED, unless the same request's writable jar already renewed the token.
  • Auth.layer (/effect) also accepts a RequestAuth. Auth.session, Auth.credentials, Auth.renew, Auth.signOut and sessionBearer then work in server functions, actions and route handlers.
    • Provide the layer per request.
    • Auth.signIn and Auth.updateUser die on the server. Call serverAuth.signIn(jar, …) and serverAuth.updateUser(jar, …) instead.
  • AuthFetch (/http) is the type createAuthFetch returns. Use it to type props, contexts and test fakes.
  • The Effect guide's "On the server" section covers a runtime for what belongs to no user, building the session and API client per request, signing in through serverAuth, and queries.

Fixed

  • A request view now follows the writable jar for good, and renews from it on a read-only jar.
  • A read-only jar whose access token had expired left state at initializing. It is now unavailable, with the session ID.
  • A request view's version stays the same through refreshes, and its state is stable when there is no secret.

Changed

  • The JSDoc on every entry point is rewritten. Each hover says what the export does first, then its errors and platform differences, with shorter examples. AGENTS.md now sets this style.
  • Statements that had drifted from the code are corrected in the JSDoc, the README and the guides:
    • when the early refresh runs
    • which jar nextJar returns
    • which options createServerAuth accepts
  • The Effect examples refresh with a client method (client.post) instead of binding an endpoint on every call.
  • Dependencies get patch and minor bumps.

- Document forRequest in the server sessions guide and README
- Keep a request view's version stable through refreshes and without a secret
- Run the mirror type test with exactOptionalPropertyTypes off
- Fix the early refresh timing, nextJar's caching and createServerAuth's options
- Clarify signOut, renew and read-only jar behaviour in the Effect docs
- Wrap long JSDoc example lines
- Declare AuthFetch as createAuthFetch's return type, with JSDoc and an example
- Add type tests for typing props and test fakes with it
@monarcode monarcode changed the title 0.1.0 alpha.8 0.1.0-alpha.8: server sessions in Effect and fetch, rewritten JSDoc Nov 12, 2026
@monarcode
monarcode merged commit 0d0f9ca into main Nov 12, 2026
3 checks passed
@monarcode
monarcode deleted the 0.1.0-alpha.8 branch November 13, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant