Repository navigation
build(tsconfig): drop the redundant react types path that blocks vite 8 - #412
Conversation
`compilerOptions.paths` mapped `react` to `./node_modules/@types/react`, a Payload-starter artifact for deduping React types. It is redundant here: `@types/react` is a pinned root devDependency (19.2.17), only one copy is ever installed, and `--traceResolution` confirms tsc resolves `react` to that same copy with the mapping gone. It is also actively harmful. `vite-tsconfig-paths` honours the mapping for *runtime* imports too, so every `import … from 'react'` gets rewritten to the types directory and handed to vite's resolver. `@types/react` declares only a `types` condition for `.`, so vite 7 returned null and fell through to normal resolution while vite 8 throws: "." is not exported under the conditions ["node", "development", "import"] That fails the two int suites which import react at runtime (fumadocs-site and template-showcases), which is what blocks the vite 8 bump in #365. Verified locally against vite 8.1.5: with the mapping removed the full int suite passes (32 files / 379 tests); restoring it reproduces exactly the CI failure (2 files failed, 270 tests passed). On vite 7.3.5 lint, format:check, tsc and test:int all stay green. Co-Authored-By: Claude Opus 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…'s line breaks (#413) Two follow-ups from the wall and prettier work, both about assertions that pass for the wrong reason. The wall fit guard allowed 60px of overrun against a measured worst case of 44px. That 44-60 band was room for a card to quietly lose a line and still go green, and twin content does drift — TestimonialsBentoDemo changed height in the same promote that shipped the guard. The ceiling is now 50px: still clear of an ordinary copy edit, but no longer a place a regression can hide. If a legitimate content change trips it, the frame should move, not the ceiling. fumadocs-site.int.spec.ts pins ~197 exact substrings of source files, and prettier owns the line breaks in every one of those files, so any pin spanning more than a single token is partly a pin on formatting. That is what broke here: the twitter literal in blog/[slug]/page.tsx crossed 100 columns, prettier split it, and the assertion failed while the metadata it guards was untouched. The whitespace- collapsing helper introduced for that case is now file-scoped and documented, and applied to the three remaining pins that span a brace, an arrow or a ternary (heroComponent's payload-types import, docsLayout's themeSwitch, siteHeader's rel ternary). Bare identifiers cannot wrap and stay matched raw. No behaviour change; both are test-only. Verified: 4/4 wall guard tests at the new ceiling, 379/380 int tests, eslint / tsc / format:check clean. The int run also confirms vite 8.1.5 is healthy on dev now that #412 dropped the tsconfig react types path that used to block it. Co-authored-by: Claude Opus 5 <[email protected]>
…dening, dependency refresh (#416) Brings main level with dev ahead of publishing 1.2.1. - wall fit guard tightened from 60px to 50px, and the fumadocs int spec no longer pins prettier's line breaks (#413) - CodeRabbit findings from the last five days closed (#411) - tsconfig drops the redundant react types path that blocked every vite 8 bump (#412), unblocking vite 8.1.5; dependency refresh for lucide-react, fumadocs and the test tooling (#365, #366, #367) - shadcn bumped to 4.15.0 with the CLI pin single-sourced, so a version bump no longer has to be written in four places (#401) Tree is identical to dev by construction: branched from dev, reparented onto main, so the diff is exactly the main..dev delta with no squash-divergence conflicts.
What
Removes one line from
tsconfig.json:"paths": { - "react": ["./node_modules/@types/react"], "collections/*": ["./.source/*"],Why it is redundant
That mapping is a Payload-starter artifact for deduping React types. Here it does nothing:
@types/reactis a pinned root devDependency (19.2.17) and only one copy is ever installed (node_modules/.pnpm/@[email protected]).tsc --traceResolutionconfirms that with the mapping gone,reactstill resolves to.../@[email protected]/node_modules/@types/react/index.d.ts.Why it is actively harmful
vite-tsconfig-pathshonourspathsfor runtime imports too, so everyimport … from 'react'is rewritten to the types directory and handed to vite's resolver.@types/reactdeclares only atypescondition for., so vite 7 returned null and fell through to normal resolution — while vite 8 throws:This is what fails #365 (
vite7.3.5 → 8.1.5). Only the two int suites that import react at runtime break —fumadocs-site.int.spec.tsandtemplate-showcases.int.spec.ts— and it happens at import time, before any assertion runs. Left alone it will block every future vite major the same way.Verification
Ran locally with
[email protected]installed, as an A/B with the mapping as the only variable:test:intOn the shipped
[email protected],lint,format:check,tsc --noEmitandtest:intare all green.Scope
This PR does not bump vite. It only unblocks the bump. #365 still needs a rebase and a full
release-gaterun — note that itstest:intfailure aborted the gate beforebuild:e2e, so@playwright/test1.62.0 has never been exercised against the visual-regression baselines.