Skip to content

chore(deps): bump sanity-plugin-mux-input and next-sanity#461

Merged
joaquimds merged 3 commits into
mainfrom
chore/sanity-plugins
Jul 23, 2026
Merged

chore(deps): bump sanity-plugin-mux-input and next-sanity#461
joaquimds merged 3 commits into
mainfrom
chore/sanity-plugins

Conversation

@joaquimds

Copy link
Copy Markdown
Member

Clears the prismjs advisory chain without touching the Sanity major:

prismjs → refractor → react-refractor → @sanity/ui → sanity-plugin-mux-input

20 → 15 advisories (5 moderates cleared).

Why no Studio migration is needed

Both plugins declare peer support for the Sanity version already in use:

Package Bump Peer range on sanity
sanity-plugin-mux-input 2.13 → 5.0.5 ^4 || ^5 || ^6
next-sanity 12.0.4 → 13.1.5 ^5.29.0 || ^6.0.0

mux-input v3 raised its floor to Studio v4 and @sanity/ui v3 — we're on Studio 5, so that's already met. No code changes were required.

next-sanity remains flagged after this: its advisory is inherited from sanity itself, which needs the v6 major (see #459 — which turns out not to help).

Verification

  • npm run lint — clean
  • npm run build — succeeds
  • npm test -- run tests/unit — 285 passed, 15 skipped

Needs a human before merge

No automated test covers the Studio UI. The Mux video input (mp4_support: "standard") and Portable Text rendering on the marketing pages both need a click-through.

🤖 Generated with Claude Code

Clears the prismjs advisory chain without touching the Sanity major:
prismjs -> refractor -> react-refractor -> @sanity/ui ->
sanity-plugin-mux-input. Five moderate advisories, 20 -> 15 total.

Both plugins declare peer support for the Sanity version already in use
(mux-input peers sanity ^4 || ^5 || ^6, next-sanity peers ^5.29.0 ||
^6.0.0), so no Studio migration is required for this change.

mux-input v3 raised its floor to Studio v4 and @sanity/ui v3; we are on
Studio 5, so that constraint is already met.

next-sanity remains flagged after this, because its advisory is
inherited from sanity itself, which needs the v6 major.

Verified with npm run lint, npm run build and the full unit suite (285
passed). The Mux video input and Portable Text rendering are Studio UI
surfaces that no automated test covers, so both need a click-through
before merge.
The self-hosted Studio at /studio and next-sanity's live/preview were
blocked by our Content-Security-Policy: connect-src had no Sanity API
host, so Studio's getCurrentUser call to <project>.api.sanity.io failed
at the network level, and script-src blocked the visual-editing bridge
(core.sanity-cdn.com/bridge.js).

This is a pre-existing gap -- connect-src never contained a Sanity host,
so the embedded Studio only ever worked via the hosted mapped.sanity.studio.
The bridge.js requirement is new with the next-sanity 13 upgrade in this
branch, which is what surfaced it.

Adds to connect-src: api.sanity.io + *.api.sanity.io (content + Studio
auth), *.apicdn.sanity.io (useCdn queries), wss://*.api.sanity.io (live
listeners), core.sanity-cdn.com (bridge). Adds core.sanity-cdn.com to
script-src. Sanity image assets already pass via img-src https:.
@joaquimds

Copy link
Copy Markdown
Member Author

Added a second commit (b4e544c) fixing the CSP that blocks the embedded /studio: connect-src had no Sanity API host (so Studio's getCurrentUser failed) and script-src blocked the visual-editing bridge (core.sanity-cdn.com/bridge.js, newly loaded by next-sanity 13). Pre-existing gap surfaced by testing the Studio locally. CSP unit tests updated.

The visual-editing bridge loads bridge.js from core.sanity-cdn.com but
then fetches the Studio's module-federation code from the bare host
(sanity-cdn.com/v1/modules/…), which core.sanity-cdn.com did not cover.

Replace the single core.sanity-cdn.com entry with sanity-cdn.com plus
*.sanity-cdn.com in both script-src and connect-src.
@joaquimds
joaquimds merged commit 2fed174 into main Jul 23, 2026
1 check passed
@joaquimds
joaquimds deleted the chore/sanity-plugins branch July 23, 2026 12:26
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.

1 participant