fix(PRO-349): accept Next 16 as a peer dependency - #54
Merged
Conversation
Two independent bugs found while testing the PRO-323 AI install prompts against real apps. @spur.us/monocle-nextjs declared next@^13.5.7 || ^14.2.25 || ^15.2.3, so installing into a Next 16 project failed peer resolution outright. The SDK already worked on Next 16 once installed; the range was just stale. @spur.us/monocle-react loaded the script from mcl.spur.us, which does not match the https://*.mcl.io wildcard that docs.spur.us/monocle/security tells customers to allowlist. A CSP is checked against the host being requested, so anyone following those docs had the SDK silently blocked. Both hosts serve byte-identical payloads and mcl.spur.us already CNAMEs to v1.mcl.io, so this is a rename rather than an infrastructure change. monocle-backend keeps BASE_DOMAIN = mcl.spur.us deliberately: it builds https://decrypt.${baseDomain}, decrypt.mcl.io has no DNS record, and decrypt.mcl.spur.us is what the decryption docs reference. Moving that needs the host provisioned first. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
benperkins
previously approved these changes
Aug 10, 2026
Anyone currently running the React SDK behind a CSP must have allowlisted mcl.spur.us to get it working, so the upgrade breaks them unless *.mcl.io is allowed too. That belongs at the top of the release note, not buried in the rationale. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drops the js.mcl.io rename. Every existing CSP user of this SDK must have allowlisted mcl.spur.us to get it working, so changing the requested host breaks them on update unless they also allow *.mcl.io first. Release notes cannot retroactively update a deployed policy, so no amount of documentation makes the upgrade risk-free. The CSP problem is fixed where it actually belongs: the security docs list only *.mcl.io while the SDK requests mcl.spur.us, so the docs get both hosts. That fixes new installs and breaks nobody. This PR is now the Next 16 peer range alone, which is purely additive. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
benperkins
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@spur.us/monocle-nextjswould not install into a Next 16 project. Found while testing the PRO-323 AI install prompts against a real app.Part of PRO-349.
The bug
The peer range stopped at
^15.2.3:Next 16.3.0 is current, so
npm install @spur.us/monocle-nextjsfailed peer resolution outright. No published version, including the0.5.1canary, listed Next 16. This blocked the manual onboarding path as much as the AI one, and pushed users toward--legacy-peer-depsor a project-wide.npmrc, both of which have effects well beyond this package.The SDK already works on Next 16 once installed, so only the range was out of date.
Why this change cannot break anyone
Widening a peer range is purely additive. Consumers on Next 13, 14 and 15 resolve exactly as before, and no runtime code changed. The only behavioural difference is that an install which previously errored now succeeds.
Verified that the combination genuinely works rather than just permitting it:
tsc --noEmitclean against Next 16.3.0next buildsucceeds, all 6 pages generated15.2.3,16.0.0,16.3.0, and correctly rejects17.0.0pnpm buildandpnpm lintpass across all 5 packagesvitest runpasses inmonocle-react(7 tests) andmonocle-backend(9 tests)What was deliberately dropped from this PR
An earlier revision also moved the React SDK's loader from
mcl.spur.ustojs.mcl.io, because the security docs tell customers to allowlisthttps://*.mcl.ioandmcl.spur.usdoes not match that wildcard.That has been reverted. Any existing customer running this SDK behind a CSP must have allowlisted
mcl.spur.usfor it to work at all, so changing the requested host breaks them on update unless they widen their policy first. Release notes cannot retroactively change a deployed CSP, so there is no way to make that rename risk-free for existing users.The CSP mismatch is instead being fixed in the documentation, which lists only
*.mcl.iowhileapps/app/src/lib/security-headers.tsinweballows*.mcl.io,wss://*.mcl.io,mcl.spur.usandwss://mcl.spur.us. Documenting all four fixes new installs and breaks nobody. A future SDK move tojs.mcl.iocan happen once customers have had time to widen their policies.monocle-backendwas never touched: it buildshttps://decrypt.${baseDomain},decrypt.mcl.iohas no DNS record, anddecrypt.mcl.spur.usis what the decryption docs reference.Reviewer notes
vitest run, sopnpm testexits instead of hanging in CI.next ^16.0.0is a devDependency ofmonocle-nextjs, so the package builds and typechecks against the newest version its peer range claims, and the CVE-flaggednext@15.3.1(CVE-2025-66478) is out of the lockfile. Dev-only; nothing consumers install changes.🤖 Generated with Claude Code