Repository navigation
feat(core): move GMT onto temporal-polyfill (CORE-108, #460) - #464
craig-o-curtis wants to merge 44 commits into
Conversation
Release notes are reference, not a place to start, so the Changelog group moves below Check. llms.txt lists its Changelog section last to match.
…ding The landing has no sidebar, so a navigation to or from it used to cut the sidebar away in one frame or pop it in. It now slides off to the left, or in from the left, on the zone drawer's duration and sweep curve, with the same band of ice light crossing it. The band moves to one shared token, --gmt-sheen, that the drawer and the sidebar both read. The sidebar's group also drops the backdrop-filter it took from the capture, which left a sidebar-shaped blur over the hero after the sidebar had gone. Reduced motion keeps the one-frame swap.
/why-gmt was the one Start here page on the splash template, so it had no sidebar and no On this page list. It is now a normal doc page. The section grid goes, the sections read top to bottom, and the Date bug section moves up to follow the intro. Its heading is now a plain ## line in the page, so it lists in On this page; WhyDateBug no longer draws one, and its card grid answers to its own container instead of the grid cell. Under the intro, a row of tiles gives the headline figures (tests, CI runs, public functions, time zones, locales), each linked to its section. The figures come from gmt-stats.json through why-gmt-figures.ts, which the page and the Markdown twin both render.
The code blocks used Starlight's default Expressive Code themes, whose blues blended into pages that are already mostly cyan. They now use a dark and a light theme that code-themes.ts builds from the --gmt-syntax-* tokens when the site builds: keywords purple, function names gold, strings green, numbers and literals rose, types cyan, comments and punctuation dim ice. These are the series colours the tools already use, through their -ink tokens. Every token is held to the 7:1 code-frame floor in both themes. Starlight still draws the frames, tabs and buttons. The widget call lines read the same tokens, so they change colour with the code blocks.
The sidebar, the prev/next links and llms.txt now list install, core-rules, then the reasons (why-gmt, compare, bundle-size) and upstream last. `astro.config.mjs` and `START_ORDER` change together.
GMT now imports Temporal from `temporal-polyfill/full/implementation`, pinned at exactly 1.0.8, through the one seam in `src/internal/temporal.ts`. Helper types that `temporal-spec` does not export live in `src/internal/temporalTypes.ts`. - A month amount too large for any date in range throws a RangeError before any polyfill arithmetic (`temporalCompat/monthRange.ts`), as the specification throws. - Workarounds for `@js-temporal/polyfill` 0.5.1 that 1.0.8 does not need are removed, each after its repros passed on every engine: the clock, field search, fixed-day and non-ISO arithmetic, the Islamic era and ISO calendar readers, the zoned transition search, and the zoned-difference helpers. - `ethiopic` and `coptic` compute in their own calendar, no longer through `ethioaa`. - Year-month arithmetic calls `PlainYearMonth#add` and `#subtract` directly. The lowest year-month, -271821-04, throws even for a zero amount, as the specification says. - The root devDependency `gmt-js-temporal-release` pins GMT 1.21.0, the last release on `@js-temporal/polyfill`, for the bundle-size comparison.
…CORE-108, #460) Library code imports Temporal only from `internal/temporal`; a direct import of `temporal-polyfill` or `@js-temporal/polyfill` is an error.
… (CORE-108, #460) The swap leg of `temporal-oracle.yml` now runs GMT's suite on the newest published `temporal-polyfill`, installed as `temporal-polyfill-candidate` beside the pinned 1.0.8, and reports what would change on an upgrade. `scripts/swap-version.mjs` picks the version. - The workaround registry, the compat snapshot and the canary reports follow the workarounds that remain on 1.0.8. - D9 is retargeted: an out-of-range month amount must throw in time that does not grow with the amount.
`scripts/bundle-size.mjs` bundles two sets with the same esbuild settings: GMT's source on `temporal-polyfill`, which the budgets gate, and GMT 1.21.0 on `@js-temporal/polyfill` as published, which is reported only. `--json` writes both sets for the Dox `/bundle-size` page. Budgets are reset to the new sizes. The script also works when run from `apps/dox`, as the Dox build runs it: esbuild's input paths are relative to the current directory.
Dox widgets import `Temporal` from `@northguild/gmt` and no longer depend on `@js-temporal/polyfill`, so the site draws with the same polyfill the library ships. A lint rule rejects a direct import of either polyfill package.
…#460) Coptic no longer computes in `ethioaa`, so the row names what it checks: Amshir has 30 days.
Install is now first in Start here, so it closes with a short example: strings in and out, a calendar day across a clock change, and the fallback values in place of exceptions.
) - `/bundle-size` charts and tabulates each polyfill alone and each single-function import, split into the polyfill and GMT's code, from the generated `bundle-size.json`. Green is `temporal-polyfill`, slate grey `@js-temporal/polyfill` as GMT 1.21.0 shipped it. `PolyfillCompare.astro` is the table and the charts' text alternative. - The figures come from `bundle-size-figures.ts`, and the Markdown twin states the same values. - The bar charts on /why-gmt and /bundle-size share `bar-chart-kit.ts`. - `/upstream` lists the defects found in each polyfill, and the native-engine failures beside them. - The install page names the polyfill each GMT version re-exports.
- The guides and the mistakes pages name `temporal-polyfill` 1.0.8 where they named `@js-temporal/polyfill` 0.5.1. - The calendar-systems guide says GMT computes `ethiopic`, `ethioaa` and `coptic` each in its own calendar, and drops the section on runtime corrections that no longer exist. - The reference corpus is regenerated from the library's JSDoc.
- AGENTS.md, the coding standards, the overviews and the audits name `temporal-polyfill` 1.0.8 and the one import seam. - The story file, the tracker row and the CORE-108 specs, which are folded into the story file when it closes. - A first draft of the changeset (minor).
The two header buttons now show from the first paint in northguild.dev's muted grey and turn cyan with their shine (`ng-shine-in`). Their colour transition is off through the entrance so it cannot flash cyan early. The hero entrance check counts every `ng-shine*` run as riding on a freeze.
…ecks The group names already say Migrate and Checks, so the entries drop the repeated words: `From Luxon`, `From native Temporal`, `Behaviour compared`, `Canada 2026 clocks`. `/compare/` reads `GMT vs. the others`. Page titles keep their full wording for headings and search.
…CORE-108, #460) The Dox test rules keep class checks out of widget tests, so the check that a chart key sits inside `.not-content` moves to `content-list-rule.test.ts`, which already checks the CSS side of the same rule.
The sky's Sun, Moon and stars scaled only to the hero's viewport, not to the Earth disc's size on screen, so zooming the globe grew the disc without the sky moving to match: a Sun that sat at the rim at rest could end up swallowed by a disc that had grown past it, or read as hidden when the sky it's judged against never grew with it.
The sky drew stars out to 120 degrees from the point behind the Earth so the hero corners are never bare, and the Sun and Moon used the same limit. A Sun past 90 degrees is behind the reader, lighting the face they see, so drawing it beyond the Earth put it below the horizon of every lit place on screen. Also gives the hero-space test's globe stub the getZoom the sky now reads, and lets the browser gate skip walk steps where the Sun is not drawn.
… window (CORE-108, #460) When a widget's mount threw, `renderWidget` kept its session open, so its listener recorder stayed on `window` for every later file in the worker. The leak guard then saw the recorder, not jsdom, as the caller of jsdom's own selector listeners and failed `bundle-size-charts.test.ts` on Node 24 and 26. - `renderWidget` ends the session and takes the recorder off when the load fails. - The leak guard looks past the recorder's frame to find the caller. - The leak guard names a file that leaves a listener method replaced. - The leak guard tracks the targets it has wrapped, so it never wraps a test's own wrapper again.
b50a60d moved the Changelog group to the end of the sidebar and of llms.txt, but the built-site test still expected it after Start here. The test only runs against a built site, so it failed in Story consistency and not locally. The tracker marks CORE-108 Done and adds CORE-109 (#467) at #45, so the last cut ships CORE-109 to SPA-52 (#45–#49).
…sion (CORE-108, #460) The Why this polyfill section takes its versions from the data only, so the wording names no release.
…108, #460) The Tests job does not build `@northguild/gmt-oxlint`, so importing the Dox oxlint config failed there. The guard now mocks the plugin's recommended rules, which never set `no-restricted-imports`. Also formats `upstream-filings.json`.
|
Back to draft until
No GMT release moves onto Every review thread so far has a reply. Once the fixes are out, this PR:
Then it goes back to ready for review. |
…-onto-temporal-polyfill
…he spec's trailing zeros (CORE-108, #460)
|
Status on 27 November 2026: still parked. Blockers
Found since the last update
This branch The plan is the same as before. Once a release fixes Persian and Chinese and Dangi, this PR raises the pin, tests the first day of each affected year against native Temporal, updates the bundle-size figures and closes #465. Then it goes back to ready for review. |
…as TC39 does (D35, CORE-108, #460) temporal-polyfill 1.0.8 adds the whole duration to a plain relativeTo, so compareDurations gave null where TC39 adds only the years, months and weeks and compares the days and time as exact nanoseconds (fullcalendar/temporal-polyfill#130). PT3000000000H against P1Y from 2000-01-01 is 1, and -P1D against P1W from -271821-04-19 is -1. - D35 workaround in internal/zonedDifference/plainCompare.ts: after the runtime throws a RangeError, with a plain relativeTo, a year, month or week on either side and the probe failing, compute DateDurationDays and Add24HourDaysToTimeDuration. It throws again where TC39 throws. - Probe repros, isDurationCompareCompatNeeded, README row, trigger and removal step 35, the workarounds.mjs entry and the Dox compat row. - A calendar-annotated plain relativeTo now resolves to a PlainDate, as Temporal does, so -271821-04-19[u-ca=gregory] no longer gives null. - operations.ts loses dead code: the plain-context rounding path, compareAtLimit and the plain total and round helpers. - The D22 and D35 removal steps name the functions to delete; fallow cannot report them.
…-onto-temporal-polyfill - upstream-filings.json: main's synced fields, its new tc39/proposal-temporal#3343 entry and the outcome lines for fullcalendar/temporal-polyfill#127 and #132; this branch's gmtGuard and gmtNote values. #128 and #132 now name D33 as their guard, since temporal-polyfill keeps Chinese and Dangi on the host's Intl on purpose. - sky-aim.test.ts and sky-names.test.ts, new on main, import Temporal from @northguild/gmt.
|
Status on 28 November 2026: still parked. Blocker
No longer a blocker
Since the last update
This branch
The plan: once 1.0.9 is out, this PR raises the pin, tests the first day of each affected Persian year against native Temporal, retires D35, checks the |
) temporal-polyfill 1.0.9 ships the Persian leap-year fix (fullcalendar/temporal-polyfill#127, PR #131) and the `Duration.compare` fix from a plain `relativeTo` (#130), so GMT moves its pin from 1.0.8 to 1.0.9. - Remove the D35 workaround: `plainCompare.ts`, its probe and repros, `isDurationCompareCompatNeeded`, the README rows, the `workarounds.mjs` entry and the Dox `WHAT_BREAKS` line. `durationCompare` calls `Temporal.Duration.compare` directly again. - Regenerate the compat snapshot without D35 (17 groups, 0 removable on Node). - Re-check every 1.0.8 claim in the source comments on 1.0.9; all hold. The D9 out-of-range timing is now about 3.5 s. - Upstream filings: #127 released, #128 closed as working as intended (D33 stays), #134 fixed in 1.0.9, and contributor entries for #129 and #130. - Docs: `/upstream/` Why this polyfill, the polyfill status table, the swap research, CORE-108 and the changeset size table. pnpm-workspace.yaml carries a `minimumReleaseAgeExclude` for temporal-polyfill 1.0.9 and temporal-utils 1.0.5 until they are a day old; a follow-up commit removes it.
…ral-polyfill' into 460-core-108-move-gmt-onto-temporal-polyfill
…108, #460) Checks 1 Farvardin of each year that follows one of the 78 Persian years from 1502 to 2987 AP where the 33-year leap rule and ICU4X disagree. The expected dates come from Node 26's built-in Temporal; temporal-polyfill 1.0.8 gives each of them a day late, 1.0.9 matches. Syncs the published test and run counts in gmt-stats.json, which were stale after the D35 tests were removed.
…RE-108, #460) temporal-polyfill 1.0.9 and temporal-utils 1.0.5 are more than a day old, so pnpm accepts them without the exclusion. The frozen install passes the supply-chain check without it.
baldurpan
left a comment
There was a problem hiding this comment.
I re-read what changed since I last reviewed at 11dbf6b: the PR's own seven commits, and the four merges of main, checked against the final tree. The move to temporal-polyfill 1.0.9 and the retirement of D35 hold up.
- The Persian test has 78 rows. Each Nowruz date matches both Node's native Temporal and temporal-polyfill 1.0.9. The first day of every Persian year from 1 to 3500 AP also agrees between the two.
compareDurationsgives the same answers as both runtimes on the range-edge and calendar-annotatedrelativeTocases, and returnsnullwhere they throw.tsc --noEmitis clean. The gmt vitest run passes, 78,184 tests in 1,034 files.- There are no conflict markers, and
AGENTS.mdandtemporal-oracle.ymlcarry both main's calendar sweep and this PR's wording.
I did not run the Dox browser or chart tests locally, because they need the Dox build.
One nit is below.
| `isTimeZoneEqualsCompatNeeded`, `timeZoneEquals`, `nowInstant`, `nowZonedDateTimeISO`, `nowPlainDateTimeISO`, `nowPlainDateISO` and `nowPlainTimeISO`, never the files behind them. | ||
| 1. **Import surface.** `index.ts` is the only import surface. Call sites use `calendarDateAdd`, | ||
| `calendarDateUntil`, `calendarDateFromMonthCode`, `longestDayOfMonthCode`, `calendarFieldsOf`, | ||
| `assertMonthsInRange`, `MAX_MONTHS_IN_RANGE`, `isDurationCompareCompatNeeded`, |
There was a problem hiding this comment.
isDurationCompareCompatNeeded went with D35 in bf98c65, but it is still listed here as part of the import surface. It is the only mention left in packages/gmt/src, so it can just be dropped from the list.
Closes #460
Summary
GMT now runs on
temporal-polyfill1.0.9 in place of@js-temporal/polyfill0.5.1. Every measured import is smaller, month arithmetic takes bounded time for any amount, and the workarounds that 1.0.9 does not need are gone. The Persian leap-year bug that held this PR back (#465) is fixed in 1.0.9.What Changed
1. Library
temporal-polyfill/full/implementation, pinned at exactly 1.0.9, throughsrc/internal/temporal.ts.Temporal,IntlandtoTemporalInstantare re-exported from it.temporal-specdoes not export live insrc/internal/temporalTypes.ts.temporalCompat/monthRange.ts). The time this takes does not grow with the amount.2. Removed workarounds
temporal-polyfillreads Chinese and Dangi dates from the host'sIntlon purpose (Chinese and Dangi: dates read from Intl differ from native Temporal (Chinese New Year 2027) fullcalendar/temporal-polyfill#128, closed as working as intended).3. Persian leap years
holidayDates.test.tschecks the first day of the year after each of the 78, against dates from Node 26's built-in Temporal.4. Weekly upgrade check
temporal-oracle.ymlruns GMT's suite on the newest publishedtemporal-polyfillbeside the pinned one, and reports what an upgrade would change. It never asks for an older version than the pin.5. Sizes, lint and Dox
scripts/bundle-size.mjsmeasures GMT's source ontemporal-polyfill, which the budgets gate, and GMT 1.21.0 on@js-temporal/polyfillas published, for comparison. Budgets are reset.Temporalfrom@northguild/gmt, and a lint rule rejects a direct import of either polyfill./bundle-sizecompares GMT on both polyfills./upstreamcovers the reports filed on each and what 1.0.9 fixed. The guides, mistakes pages and migrate page nametemporal-polyfill.Sizes, minified and gzipped, from
bundle-size.json:temporal-polyfill1.0.9@js-temporal/polyfill0.5.1isValidDateformatDateaddBusinessDayschargeableDaysdutyViolationsThe left column is this branch's source, so it includes what GMT gained after 1.21.0.
Breaking changes
compareDurationsreturns0for two durations with the same fields, where 1.21 returnednullwhenrelativeTowas in a non-ISO calendar and adding them went past Temporal's date range.smallestUnitinparseDurationandtoStringSmallestUnitinDurationStringOptionsno longer accept"minute"or"minutes"at the type level. Run-time behaviour is unchanged.Temporal.*type names change. The changeset has the full table.Validation
main. fix(dox): press the Sunshine inset frames at rest, and slim the Dox CI #595 addeddescribe.skipIfinsound-peaks.browser.test.tsandzone-map-forced-colors.browser.test.ts, whichscripts/test-markers.mjsrejects. This PR changes neither file. The check stops there, so its later steps did not run on this commit; they passed on 829f8f3.temporal-oracle.yml. Its last run on this branch was on 1.0.8 (5cfd1f2): the native suites passed in Chromium and Firefox and failed in Node and WebKit, and the polyfill swap legs were skipped.Risk / Impact
Medium. Every Temporal call in GMT now runs on a different implementation, and the diff touches about 600 files. Firefox is the open gap listed above.
Before merging
mainpasses Story consistency again.temporal-oracle.ymlruns on this branch with 1.0.9.Release
.changeset/move-onto-temporal-polyfill.md,minor. Merging publishes nothing.