Skip to content

Migrate from date-fns and Date to Temporal - #32

Merged
haziq21 merged 2 commits into
mainfrom
feat/temporal
Nov 19, 2026
Merged

haziq21 merged 2 commits into
mainfrom
feat/temporal

Conversation

@haziq21

@haziq21 haziq21 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Replaces date-fns and Date with Temporal end to end, and upgrades the toolchain that needs. Two commits: the migration, then the switch to adapter-vercel.

Temporal

  • App date logic uses Temporal.PlainDate and Temporal.ZonedDateTime. dayKey and the Monday week start are unchanged.
  • Drizzle timestamptz / plainDate custom types map to Temporal.Instant / Temporal.PlainDate. No schema change.
  • @politeshop/lib returns Temporal.Instant for every timestamp. Breaking, so the changeset is major. Consumers need native Temporal and "ESNext.Temporal" in their TS lib.
  • ext uses Temporal.Instant for token expiry and sets minimum_chrome_version: "144".
  • Temporal values travel through load data and remote functions with no transport hook, since devalue 5.9 supports them.

Toolchain

  • TypeScript 6.0.3 everywhere. TS 7 has no JS API, which svelte-check, vite-plugin-dts and Kit 3 rely on.
  • Node 26 (native Temporal; Node 24 lacks it): engines.node, .nvmrc and the release workflow. Vercel's Node.js Version setting needs to be 26.x.
  • SvelteKit 3.4, Vite 8, Svelte 5.58, migrated per sv migrate sveltekit-3 and the migration guide: config moves into vite.config.ts, $lib becomes #lib, $app/env and $app/state, defineEnvVars in src/env.ts (read at runtime rather than inlined at build), Response.json(), and a full-page-load fallback when goto rejects an unrouted link.
  • Playwright 1.65.1, where page.clock also drives Temporal.Now, so the e2e tests no longer need a clock shim.
  • adapter-vercel replaces adapter-auto; the runtime comes from engines.node.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
politeshop Ready Ready Preview Nov 19, 2026 6:33am UTC

Comment thread app/src/lib/index.ts Resolved
Comment thread app/src/routes/d2l/home/+page.svelte Resolved
Comment thread app/src/routes/+layout.svelte Resolved
Comment thread lib/clients/brightspace.ts Resolved
Comment thread lib/utils/url.ts Resolved
Comment thread app/src/lib/server/db/temporal.ts Resolved
Comment thread app/src/lib/dates.ts Resolved
Comment thread app/e2e/deadlines.spec.ts Resolved
haziq21 and others added 2 commits November 19, 2026 14:33
- Replace date-fns and `Date` with Temporal across app, ext, lib and e2e
- POLITELib returns `Temporal.Instant` (major changeset)
- Drizzle custom column types for timestamps and dates, no schema change
- TypeScript 6.0.3 in every package
- Node 26 (`engines`, `.nvmrc`, release workflow); extension requires Chrome 144
- Playwright 1.65.1, whose clock mocks `Temporal.Now` natively
- SvelteKit 3.4 with Vite 8 and Svelte 5.58, migrated per `sv migrate sveltekit-3`

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@haziq21
haziq21 merged commit d164998 into main Nov 19, 2026
2 checks passed
@haziq21
haziq21 deleted the feat/temporal branch November 19, 2026 07:21

This branch was successfully deployed

1 active deployment
Preview — db6ccd9b Deployed Nov 19, 2026 by vercel[bot]
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