Skip to content

LTRAC-873: fix(cli) - Derive Wrangler compatibility_date dynamically#3045

Merged
jorgemoya merged 1 commit into
alphafrom
jorgemoya/ltrac-873-compat-date-sync
Jun 11, 2026
Merged

LTRAC-873: fix(cli) - Derive Wrangler compatibility_date dynamically#3045
jorgemoya merged 1 commit into
alphafrom
jorgemoya/ltrac-873-compat-date-sync

Conversation

@jorgemoya

@jorgemoya jorgemoya commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Linear: LTRAC-873

What/Why?

The CLI pinned compatibility_date: '2025-09-15' in the generated wrangler.jsonc, while Ignition stamps a dynamic current date at deploy time (made dynamic deliberately in ignition#245 per Cloudflare guidance). The result: worker bundles were built against ~9-month-old Cloudflare runtime semantics but deployed under today's — compat-date-gated runtime changes could alter behavior the bundle was never built for.

Per agreement with @chanceaclark, both sides now derive the date as current UTC date minus one month — recent enough to track Cloudflare runtime behavior, buffered enough to avoid brand-new date-gated changes. Since the CLI build always precedes the Ignition deploy, the bundle is never built against newer semantics than it runs under.

Companion Ignition PR applies the same offset on the deploy side: ignition#288. The compat flags, Durable Object classes, and migration tag remain manually synced by convention — this PR adds cross-referencing comments for them.

Refs LTRAC-873

Testing

  • New unit tests for getCompatibilityDate() cover the one-month offset and month-end normalization (pnpm exec vitest run src/cli/lib/wrangler-config.spec.ts).
  • Full package suite green: 312 tests, typecheck, lint.

Migration

None — no public API changes. Generated .bigcommerce/wrangler.jsonc will show a rolling date instead of 2025-09-15.

The build pinned compatibility_date to 2025-09-15 while the deployment
service stamps a current date at deploy time, so workers ran under newer
Cloudflare runtime semantics than they were built against. Compute the
date as current UTC date minus one month, matching the same offset the
deployment service applies, so build and deploy semantics stay aligned.

Refs LTRAC-873
Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0a9b1af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Jun 11, 2026 7:02pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from 874e332 (2026-06-11).

No bundle size changes detected.

@jorgemoya jorgemoya marked this pull request as ready for review June 11, 2026 19:06
@jorgemoya jorgemoya requested a review from a team as a code owner June 11, 2026 19:06
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 93 92 95

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 77 68 69 95
Accessibility 95 95 95 92
Best Practices 100 100 100 100
SEO 88 88 100 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.5 s 6.3 s 6.0 s 2.9 s
CLS 0.04 0.183 0.039 0
FCP 1.2 s 1.2 s 1.2 s 1.1 s
TBT 0 ms 0 ms 0 ms 10 ms
Max Potential FID 40 ms 50 ms 50 ms 70 ms
Time to Interactive 3.6 s 6.4 s 6.0 s 4.4 s

Full Unlighthouse report →

@jorgemoya

Copy link
Copy Markdown
Contributor Author

Tested locally and build and deployment works as expected:

✔ Project built                                                                                                                                       3:26:33 PM
ℹ Generating bundle...                                                                                                                                3:26:33 PM
✔ Bundle created at: /Users/jorge.moya/dev/catalyst/core/.bigcommerce/bundle.zip                                                                      3:26:35 PM
ℹ Generating upload signature...                                                                                                                      3:26:35 PM
✔ Upload signature generated.                                                                                                                         3:26:35 PM
ℹ Uploading bundle...                                                                                                                                 3:26:35 PM
✔ Bundle uploaded successfully.                                                                                                                       3:26:35 PM
ℹ Creating deployment...                                                                                                                              3:26:35 PM
✔ Deployment started...                                                                                                                               3:26:36 PM
ℹ Fetching deployment status...                                                                                                                       3:26:36 PM
✔ Deployment completed successfully.
✔ View your deployment at: https://jm-testing-integration.catalyst-sandbox-integration.store     

@jorgemoya jorgemoya merged commit 4035531 into alpha Jun 11, 2026
23 checks passed
@jorgemoya jorgemoya deleted the jorgemoya/ltrac-873-compat-date-sync branch June 11, 2026 20:30
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.

2 participants