eng-1922-downgrade-react-globally#1234
Draft
maparent wants to merge 7 commits into
Draft
Conversation
React 19's react-dom bundles createElement("script") from its hoistable
resource/preload APIs, which trips the Obsidian community-plugin store's
automated review (flagged in ENG-1988). Pin the Obsidian app to React 18.2.0
to remove the pattern.
- Set catalog:obsidian react/react-dom to 18.2.0 (matching catalog:roam so
both apps dedupe to a single React copy). tldraw@3.14.2 peer-accepts ^18.
- Widen two manually-assigned refs to useRef<T | null>(null); React 18 types
make RefObject.current read-only otherwise.
Verified: rebuilt dist/main.js has 0 createElement("script") occurrences
(was 3) and carries React 18.2.0; check-types and Obsidian lint pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes packages/ui type-check break from the previous commit. The workspace shares a single hoisted @types/react; changing obsidian's @types to 18 flipped that global slot, leaking React 18 types into type-less deps (lucide-react, sonner) consumed by React 19 packages/ui. Only the runtime react/react-dom (which the bundle depends on) needs to be 18.2.0 to remove createElement("script"). @types stay on ^19 as before, so the hoist slot is unchanged and packages/ui is untouched. Reverts the now-unneeded useRef typing change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
With obsidian on react 18.2.0 and website/ui on 19, pnpm hoisted a single
react into the shared .pnpm store, and the version it picked flipped to 18.
Vercel's pruned website-only build then dangled on .pnpm/node_modules/react
(18.2.0 not in its graph) -> ENOENT.
Exclude react/react-dom from hoisting so no shared bare copy exists; every
package resolves its own anchored react via its declared dep/peer. Verified:
full check-types 8/8, obsidian bundle has 0 createElement("script") and React
18.2.0, website builds clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Testing showed hoistPattern was unnecessary (the website builds cleanly with react@18 hoisted) and it could not fix the Vercel failure anyway: it only applies on a clean node_modules, and Vercel reuses a cached one. The Vercel red is build-cache staleness from the react 19->18 transition, not a code issue, and is resolved by a clean install rather than a workspace change. Net change is now just catalog:obsidian react/react-dom -> 18.2.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Base automatically changed from
eng-1992-downgrade-obsidian-react-version-to-18
to
main
July 20, 2026 20:14
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.
Another approach to the same problem: Use React 18 everywhere.
Requires a small patch to nextra-theme-docs, due to a known bug:
shuding/nextra#5007