Skip to content

fix(web): lazy-load city-timezones to restore script transfer budget - #5200

Merged
tyler-dane merged 4 commits into
mainfrom
cursor/lazy-city-timezone-search-a03b
Nov 10, 2026
Merged

tyler-dane merged 4 commits into
mainfrom
cursor/lazy-city-timezone-search-a03b

Conversation

@tyler-dane

@tyler-dane tyler-dane commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

#5185 wired city-timezones into filterTimeZones via a static import on timezone-catalog.ts. That module sat on the boot graph through TimezoneDialogHost (always mounted) and timezone-mismatch → DefaultTimezonePicker → settings, pushing desktop script transfer on main to ~1.35 MB (median 1,349,794 bytes vs 1,065,000 budget; last green main ~974 KB).

After merging current main into this branch, #5204 made it worse locally (~1.10 MB) by importing remainderMasterId from series-split.ts, which used node:crypto and pulled the browser crypto polyfill onto the eager graph via projectRecurringEdit (same class of regression as #5101).

Fix

  • Split timeZoneCityName into timezone-iana-label.util.ts so mismatch/settings never import the catalog.
  • Lazy-load TimezonePickerDialog from TimezoneDialogHost (same pattern as booking settings).
  • Load @core/timezone/city-timezone-search only through place-timezone-search.lazy.ts (dynamic import()); TimezoneCombobox preloads on mount and refreshes results when the chunk arrives.
  • Replace node:crypto in series-split.ts with sha256-hex.util.ts so recurrence split IDs stay deterministic without the crypto polyfill on boot.
  • macOS still uses city-timezone-index.json from desktop:export; core search logic unchanged.

Performance

Metric Main (98d7b9a, CI median) After this branch (local Lighthouse median, 3 runs)
Desktop script transfer 1,349,794 bytes (fail) 980,024 bytes (pass)
Desktop LCP ~2.5s (at budget) 2,157 ms
Mobile LCP (warn-only) ~11.2s 9,036 ms (warn)

Local run: COMPASS_CONFIG_FILE=…/compass.perf.yaml build, bunx serve on build/web:9161, bun .github/perf/assert-budget.ts.

Tests

  • bun test:web -- apps/calendar-web/src/timezone
  • bun test:core -- packages/core/src/timezone and packages/core/src/util/series-split.test.ts
  • bun lint, bun type-check

VERDICT: PASS (focused suites + local perf budget; full bun run verify --strict not run on this VM)

Open in Web Open in Cursor 

TimezoneDialogHost and timezone-mismatch no longer statically import the
picker catalog that embeds city-timezones. Place search preloads when the
combobox opens.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Nov 9, 2026
@tyler-dane
tyler-dane enabled auto-merge November 9, 2026 23:48
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Boot bundle: 574.3 KB gzip (+0.0 KB vs main)

cursoragent and others added 3 commits November 10, 2026 03:25
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Satisfy Biome exhaustive-deps in TimezoneCombobox when the city-timezones
chunk loads. Replace node:crypto in series-split with a browser-safe SHA-256
so #5204 does not pull the crypto polyfill onto the boot graph.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@tyler-dane
tyler-dane added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 43986fb Nov 10, 2026
36 checks passed
@tyler-dane
tyler-dane deleted the cursor/lazy-city-timezone-search-a03b branch November 10, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants