Repository navigation
chore(deps): upgrade Schedule-X to 4.9.1 with Temporal dates - #450
Conversation
Moves @schedule-x/calendar, calendar-controls and theme-default from 2.36.0 to 4.9.1 and @schedule-x/react to 4.1.0, and adds temporal-polyfill 0.3.2, the exact version the calendar now declares as a peer. Since 3.0 the calendar takes Temporal objects: events, selectedDate, the controls' setDate and the date callbacks. CalendarView keeps the wall-clock entries lib/shape builds and anchors them in the calendar's `timezone`, set to the viewer's zone. Left at Schedule-X's UTC default, "today" and every wall clock moved for anyone off UTC. The patch is re-derived against 4.9.1. Every 2.36.0 change is still needed (schedule-x#1223 is open, no fix linked), plus two lookups 4.x added (the month-agenda dots slot, the week-agenda wrapper). One new change binds the core to the temporal-polyfill module: it reads a global `Temporal`, and the polyfill's own global install overwrites the host page's `Temporal`, `Intl.DateTimeFormat` and `Date.prototype`. shadow-patches.test.ts pins the binding and the month agenda's lookup, and a new spec renders under a foreign global `Temporal`. Each spec was watched failing against pristine 4.9.1, against the binding alone, and against the shadow changes alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
Schedule-X's declarations name a global `Temporal` namespace this
project's `lib` does not declare, so every date it takes or returns was
`any`: the 2.x call `setDate('2026-11-19')` still compiled, and would have
thrown at runtime. A types-only alias to the polyfill's own types makes
those resolve. Tried before the specs were migrated, it flagged exactly
the ones still on the old string API. It declares no value, so a bare
`Temporal.Now` stays a compile error, matching a runtime with no global.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
The root guide's Calendar row names the new pins and warns off `temporal-polyfill/global`. The patch register row is rewritten for 4.9.1, the Temporal binding included, and a list beside it names every change the patch makes, what is new against 2.36.0, and what still reads `document`. The state guide's isCalendarSmall note gains the year grid, the one 4.x rule on that class that is not the header's. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
…lock The `timezone` option and the wall-clock anchoring move into `scheduleXTimeline` (views/CalendarView/timeline.ts), which CalendarView spreads into its config. A jsdom spec renders a Los Angeles viewer at 23:30 and checks today and the class time; it failed with `timezone` removed and with the zone forced to UTC, which CI's own UTC clock could not catch before. A wall clock inside the viewer's spring-forward gap moved the start an hour later but anchored the end on its own, so a class could end before it started. The end now keeps the entry's length when the start moves. The conversion is memoized: the grid re-renders on every route change, and with 1,800 entries it cost 110-150 ms of long tasks per Filters click at 4x CPU throttling. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
Schedule-X 4's `start` and `end` getters call `withTimeZone` on every read, even when the event is already in the calendar's zone. Sorting and laying out a full feed reads each event thousands of times, so with 1,800 entries at 4x CPU throttling the week view took 2.0 s against 0.6 s on 2.36. The patch returns such an event as is, in all three builds; CalendarView anchors every entry in that zone. A spec reads one event twice and expects the same object, and expects an event in another zone to come back re-zoned. It failed with the hunk removed and with the shortcut forced on for every zone. The register records the change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
…file The note described the state before the declaration existed. It now says what the declaration prevents. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
Schedule-X sorts, groups and labels events through `toString()`, and the polyfill formats afresh on every call. Each entry's start and end are now a `ZonedDateTime` subclass that keeps its own string; any call with options still formats. This relies on the patched getters handing the same object back. A spec counts the prototype's `toString` calls: it failed with two calls once the memo was removed. Measured on a built Ladle story with 450 weekly classes (1,800 entries), Chromium, median of 3, against 2.36 / the branch before these fixes / now: - 4x CPU, 1280px: first grid 3.6 / 6.9 / 4.1 s; Week 0.55 / 2.0 / 0.78 s; List 2.4 / 4.9 / 2.3 s; month paging long tasks 0.14 / 0.91 / 0.28 s. - 4x CPU, 390px: first grid 3.0 / 6.1 / 3.9 s; paging 0 / 0.95 / 0.11 s. - 1x CPU, 1280px: first grid 1.25 / 2.46 / 1.57 s; Week 0.11 / 0.43 / 0.18 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
Schedule-X 4 reuses a freed column for a staggered class, so a busy evening's week view can hide a class's time behind its neighbours. The calendar chunk grows by about 26 KiB gzipped and draws a large feed somewhat more slowly. No host contract changes. The entry carries no PR reference yet: the number does not exist. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | 7b70887 | Nov 20 2026, 12:33 AM |
Resolves the conflict #443 and #445 created under way. CHANGELOG.md, [Unreleased] § Changed: both bullets kept. The calendar's week-layout entry and #445's map-library entry describe different changes and neither replaces the other. src/lib/shadow-patches.test.ts: #443's new `patch` field on the Schedule-X entry points at 4.9.1, the version this branch pins and patches, instead of 2.36.0. The register spec compares those paths with `pnpm.patchedDependencies`, so the textual merge left it naming a patch file that no longer exists. pnpm-lock.yaml: regenerated from origin/main's rather than kept as the textual merge of two dependency upgrades. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYx5SsxtLkQPCFYyTF
|
Merged
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
`export import Temporal = Polyfill` inside `declare global` aliases the whole namespace the polyfill publishes, instead of re-declaring two of its types by hand. Every type Schedule-X names is covered now, including ones its signatures reach but ours do not, and the next version needs no edit here. The alias stays type-only, so `Temporal.Now` is still a compile error — there is no global at runtime, and binding one is what the patch avoids. `temporal-polyfill/global` would declare it, along with `Intl.DateTimeFormat` overloads and `Date.prototype.toTemporalInstant`, all three of which only exist once the global install runs. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY8jstKnZva2Ji2skM
Two of the file's four declarations only named a step. `memoized` adapted a `ZonedDateTime` into the memoizing subclass, so that is the subclass's own constructor now; `toScheduleXEvent` had one call site and existed to avoid a nested block, at the cost of threading the zone through a parameter. What is left is the class, whose `toString` memo each of its specs still fails without, and the exported function. The polyfill never reconstructs an instance through `this.constructor`, `new.target` or `Symbol.species`, so narrowing the subclass constructor is safe. `DateTime.local().zoneName` stays: it is how this repo reads the viewer's zone (`src/lib/shape/event.ts`), and CalendarView labels this same grid with it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY8jstKnZva2Ji2skM
The file's own header says entries reference the pull request that landed them, and the week-layout entry had none. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY8jstKnZva2Ji2skM
|
Both review threads answered, each with a commit. Lean gate green on
Both threads left open.
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#450 rewrote the Calendar row this branch had trimmed. The merged row keeps main's Temporal sentence and its `temporal-polyfill/global` gotcha, and keeps this branch's removal of the copied version numbers. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYDSPiLMRgvZD3Jsx5
…hunk by hunk (#454) #450 re-derived the patch for 4.9.1 and rewrote its walkthrough: a count of lookups, an inventory of every one, and a list of what changed since 2.36. Each upgrade would rewrite all three. The guide keeps what each hunk is for, the ⚠ instanceof trap, and what is deliberately left unpatched; the pin spec holds the built files. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
This moves the calendar's grid library, Schedule-X, from 2.36.0 to 4.9.1, its current major:
@schedule-x/calendar,calendar-controlsandtheme-defaultgo to 4.9.1, and@schedule-x/reactto 4.1.0.temporal-polyfill0.3.2 is a new exact peer.@preact/signals ^2was already a peer of 2.36.Schedule-X 4 takes and returns
Temporalobjects and draws everything in a singletimezone. The shadow-DOM patch is re-derived for 4.9.1. It now also binds the core to the polyfill module, so the widget never installs or reads a page-wideTemporal.The first version of this upgrade made the calendar 2–8× slower on a production-size feed. This PR also fixes the two root causes inside Schedule-X 4 and memoizes our conversion. What remains is a modest slowdown on very large feeds, measured below. Whether that, and the +26 KiB gz lazy calendar chunk, are acceptable is a maintainer decision.
What changed and why it matters
Dates and time zones (
src/views/CalendarView/timeline.ts)lib/shapestill produces wall-clock strings.scheduleXTimelineconverts them at the Schedule-X boundary:timezone, so "today" is the viewer's. Schedule-X's default is UTC: a Los Angeles visitor at 23:30 saw tomorrow lit as today, and every class shifted 8 h.shortcut:: such a class shows an hour late.selectedDate, the controls'setDate,onSelectedDateUpdateandonClickPlusEventsall useTemporal.PlainDate.src/types/temporal.d.tsaliases the polyfill's ownTemporalnamespace onto the global name Schedule-X's own types use and never declare, so what it takes and hands back is typed rather thanany. The alias is type-only, soTemporal.Nowstays a compile error: there is no global at runtime.The Schedule-X patch (
patches/@[email protected], all three builds). The register insrc/components/AGENTS.mdlists every change.<html>. That includes two lookups new in 4.x, the month-agenda dots and the week agenda. Upstream schedule-x#1223 is still open.Temporalis bound to thetemporal-polyfillmodule. The polyfill's documented global install would overwrite the host page'sTemporal,Intl.DateTimeFormatandDate.prototype.toTemporalInstant.withTimeZoneon every read ofstart/end, and sorting and layout read each event thousands of times. That was the larger half of the slowdown.String memo.
scheduleXTimelineis the file's one function, and each entry's start and end are aZonedDateTimesubclass that keeps its owntoString(). Schedule-X sorts and groups events throughtoString(), and the polyfill formats afresh on every call. That was most of the rest of the slowdown.Visible to visitors (CHANGELOG entry under [Unreleased]):
docs/embedding.mdis unchanged.Verification
.claude/skills/pr-prep/check.shpasses on the tip7b70887a: lint, typecheck, 178 files / 2148 tests. The branch carriesorigin/main049ff3c as a merge commit (ci(dispatch): grant the dispatcher pull-requests: write #441, test(deps): pin the vaul patch and fail on any unpinned patch #443, chore(deps): upgrade react-map-gl to 8 through its Mapbox entry #445 on top of the 775dcea it was rebased onto), and--fullpassed on that merge: build with its CSS-scope, source-map and classic-bridge asserts, and size.pnpm ladle:buildandpnpm check:wranglerpass.pnpm install --frozen-lockfileis clean, and the Schedule-X patch applies.pnpm size, gzipped): unchanged, measured onorigin/main775dcea and on this branch. Re-measured on the 049ff3c merge: 333.5 / 334.6 / 2.8 KiB gz.gzipat its default level).timezoneremoved (got 3:00 AM) and with the zone forced to UTC (today was the 20th).toStringmemo: failed with the memo removed.TZ=America/Los_AngelesandTZ=Asia/Kolkata.Not done / not verified
fetchEventswindowing was rejected. The review suggested it. In a jsdom A/B it doubled Week and List times, because Schedule-X renders the old list for the new range before the async fetch resolves.CalendarGriditself, so deleting...timelinefrom CalendarView's config would not fail a test. The helper is guarded.pnpm review:embed(hard-wired to port 5174 and needs a backend).getDirectionstill reads the host's<html dir>, unpatched as on 2.36.Follow-ups for the maintainer
PATCHESentry'spatchpath withpnpm.patchedDependencies; git merged both sides cleanly and left the Schedule-X entry naming the 2.36.0 file this branch deletes.src/lib/shadow-patches.test.tsnamespatches/@[email protected]now.pnpm.patchedDependenciesfrompackage.jsonintopnpm-workspace.yaml; whichever lands second carries this patch entry across.CHANGELOG.mdstill conflicts with chore: pay down audited tech debt across deps, data, bundle and CI #442 under [Unreleased]; keep both entries. chore(deps): upgrade react-map-gl to 8 through its Mapbox entry #445's conflict is resolved in the merge, and test(browser): add a hermetic Playwright lane that blocks in CI #444 merges cleanly. chore: pay down audited tech debt across deps, data, bundle and CI #442 also changespackage.jsonandpnpm-lock.yaml, which merge textually, but whichever lands later should regenerate the lockfile fromorigin/main's rather than trust the merged one.nb-NO, new in Schedule-X 4, could joinSX_LOCALES..claude/edit was needed.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjY8jstKnZva2Ji2skM