Skip to content

fix: revert "feat(cli-build): preconnect and modulepreload the CDN sanity module for auto-update studios (#1276)"#1400

Merged
juice49 merged 2 commits into
mainfrom
fix/sapp-3956/preloading-safari-cors
Jun 29, 2026
Merged

fix: revert "feat(cli-build): preconnect and modulepreload the CDN sanity module for auto-update studios (#1276)"#1400
juice49 merged 2 commits into
mainfrom
fix/sapp-3956/preloading-safari-cors

Conversation

@juice49

@juice49 juice49 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

This reverts commit 71d4f20.

Auto-updating studios built with this CLI feature completely fail to render in Safari, due to CORS.

Let's revert this optimisation so folks have a path to unblock themselves if they are affected (update CLI and redeploy). We can then take a look at whether preloading can be reimplemented without breaking Safari.

What to review

Reverted code.

Testing

Studios build—sans the preload code—and are able to load in Safari again. Tests pass.


Note

Low Risk
Removes performance hints only; restores prior behavior for timestamped import maps and CSS, with no auth or data-path changes.

Overview
Reverts the auto-update studio HTML injection that added link[rel="preconnect"] and link[rel="modulepreload"] for the CDN sanity module (PR #1276), because those hints break studio rendering in Safari due to CORS.

addTimestampImportMapScriptToHtml again only refreshes import-map timestamps and injects timestamped stylesheets; CDN hostname detection for timestamp replacement is inlined in replaceTimestamp instead of a shared isSanityCdnUrl helper. The preconnect/modulepreload unit tests are removed, and @sanity/cli-build is bumped as a patch in the changeset.

Reviewed by Cursor Bugbot for commit e955833. Bugbot is set up for automated code reviews on this repo. Configure here.

…nity module for auto-update studios (#1276)"

This reverts commit 71d4f20.

Auto-updating studios built with this CLI feature completely fail to
render in Safari, due to CORS.
@juice49 juice49 changed the title fix: revert "feat(cli-build): preconnect and modulepreload the CDN sa… fix: revert "feat(cli-build): preconnect and modulepreload the CDN sanity module for auto-update studios (#1276)" Jun 29, 2026
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @sanity/cli

Compared against main (9f50d269)

@sanity/cli

Metric Value vs main (9f50d26)
Internal (raw) 2.7 KB -
Internal (gzip) 1.0 KB -
Bundled (raw) 11.16 MB -
Bundled (gzip) 2.10 MB -
Import time 895ms -8ms, -0.9%

bin:sanity

Metric Value vs main (9f50d26)
Internal (raw) 782 B -
Internal (gzip) 423 B -
Bundled (raw) 9.87 MB -
Bundled (gzip) 1.78 MB -
Import time 2.31s -13ms, -0.6%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — @sanity/cli-core

Compared against main (9f50d269)

Metric Value vs main (9f50d26)
Internal (raw) 106.7 KB -
Internal (gzip) 26.7 KB -
Bundled (raw) 21.72 MB -
Bundled (gzip) 3.46 MB -
Import time 808ms +13ms, +1.6%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — create-sanity

Compared against main (9f50d269)

Metric Value vs main (9f50d26)
Internal (raw) 908 B -
Internal (gzip) 483 B -
Bundled (raw) 931 B -
Bundled (gzip) 491 B -
Import time ❌ ChildProcess denied: node -
Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

@bjoerge bjoerge marked this pull request as ready for review June 29, 2026 09:05
@bjoerge bjoerge requested a review from a team as a code owner June 29, 2026 09:05
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Delta

File Statements
packages/@sanity/cli-build/src/actions/build/renderDocumentWorker/addTimestampImportMapScriptToHtml.ts 100.0% (±0%)

Comparing 1 changed file against main @ 9f50d26933d4f777de08e023e4714e2367dcf282

Overall Coverage

Metric Coverage
Statements 74.3% (±0%)
Branches 64.2% (±0%)
Functions 68.8% (±0%)
Lines 74.9% (±0%)

@juice49 juice49 merged commit e29d4bb into main Jun 29, 2026
60 of 62 checks passed
@juice49 juice49 deleted the fix/sapp-3956/preloading-safari-cors branch June 29, 2026 09: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