Commit Graph
7 Commits
Author SHA1 Message Date
Alaister Young 5c9d3209de feat(studio): session-scoped Vercel skew protection for the TanStack SPA
Pin each browser session to the deployment that served it, so a long-lived
dashboard session never 404s on a lazily-loaded chunk or changes version
mid-session. Session cookie (no expiry) → next visit gets latest.

- vite.config: inline VERCEL_DEPLOYMENT_ID + VERCEL_SKEW_PROTECTION_ENABLED.
- router.tsx (TanStack-only): set a session __vdpl cookie scoped to BASE_PATH
  on client boot (platform + skew-enabled only); plus a vite:preloadError
  backstop that clears the pin and reloads if a chunk 404s (e.g. the pinned
  deployment aged out), with a time-window guard against reload loops.
- deployment-commit-query: fetch the version-check endpoint with
  credentials:'omit' so the __vdpl cookie isn't sent and the edge serves the
  LATEST deployment — the update popup keeps detecting new versions while the
  session stays pinned. Stays on the basePath URL (root /api is the marketing
  site in prod).
- use-check-latest-deploy: the Refresh button clears __vdpl before reloading
  so it lands on latest (no-op on the Next build, which sets no cookie).

Requires enabling Skew Protection + System Env Vars in the Vercel project, and
a Maximum Age comfortably above typical session length.
2026-06-19 14:48:14 +08:00
Joshen Lim 7f5865872a Enforce noUnusedLocals and noUnusedParameters in tsconfig.json + fix all related issues (#45264)
## Context

Enforce `noUnusedLocals` and `noUnusedParameters` in tsconfig.json + fix
all related issues
2026-04-27 17:42:34 +08:00
Charis 3b7052b5a9 cleanup: fix import order and prefixes for studio/data (#44501) 2026-04-03 09:15:57 +02:00
Ivan Vasilov 8b657165b5 chore: Migrate to use custom type for ReactQuery queries and mutations (#40073)
* Add custom types for queries, mutations and infinite queries.

* Migrate all queries to use the new type.

* Migrate all infinite queries to useCustomInfiniteQueryOptions.

* Migrate all mutations to use useCustomMutationOptions.

* Add type to all imports in `types` folder.
2025-11-03 13:18:13 +01:00
Joshen Lim 64e3e047eb Final final cleaning up barrel files (#40018)
* Final final cleaning up barrel files

* Fix merge conflict
2025-10-31 14:02:59 +08:00
Alaister YoungandJoshen Lim 8855d05803 chore(studio): swap react-query to object syntax (#39842)
* chore(studio): swap react-query to object syntax

* Fix small issues found

* Fix realtime settings

* Nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-27 09:38:27 +01:00
Ivan VasilovandJoshen Lim 1bc28c7f85 feat: Add a toast to refresh the page if there's a new version of Studio available (#36323)
* Initial work.

* Add missing import.

* Minor fixes.

* Minor fixes.

* Add a feature flag for the refresh toast.

* Add a commit for testing. Revert before merging.

* Remove header caching for testing.

* Tiny lint

* Fix

* One more

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-07-28 17:51:00 +08:00