Skip to content

build(tsconfig): drop the redundant react types path that blocks vite 8 - #412

Merged
Ducksss merged 1 commit into
devfrom
fix/tsconfig-react-types-path
Jul 29, 2026
Merged

Ducksss merged 1 commit into
devfrom
fix/tsconfig-react-types-path

Conversation

@Ducksss

@Ducksss Ducksss commented Jul 29, 2026

Copy link
Copy Markdown
Owner

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/react is a pinned root devDependency (19.2.17) and only one copy is ever installed (node_modules/.pnpm/@[email protected]).
  • tsc --traceResolution confirms that with the mapping gone, react still resolves to .../@[email protected]/node_modules/@types/react/index.d.ts.

Why it is actively harmful

vite-tsconfig-paths honours paths for runtime imports too, so every import … from 'react' is 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:

Error: "." is not exported under the conditions ["node", "development", "import"]
from package .../node_modules/@types/react
  Plugin: builtin:vite-resolve
  ❯ viteResolve  vite-tsconfig-paths/src/index.ts:115:9

This is what fails #365 (vite 7.3.5 → 8.1.5). Only the two int suites that import react at runtime break — fumadocs-site.int.spec.ts and template-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:

vite react path test:int
fix 8.1.5 removed ✅ 32 files / 379 tests
control 8.1.5 restored ❌ 2 files failed / 270 passed — reproduces CI exactly
shipped state 7.3.5 removed ✅ 32 files / 379 tests

On the shipped [email protected], lint, format:check, tsc --noEmit and test:int are all green.

Scope

This PR does not bump vite. It only unblocks the bump. #365 still needs a rebase and a full release-gate run — note that its test:int failure aborted the gate before build:e2e, so @playwright/test 1.62.0 has never been exercised against the visual-regression baselines.

`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]>
Copilot AI review requested due to automatic review settings July 29, 2026 10:55
@vercel

vercel Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
payload-components Ready Ready Preview, Comment Jul 29, 2026 11:02am
payload-components-97bf Ready Ready Preview, Comment Jul 29, 2026 11:02am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Ducksss, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 17345bf5-c7cc-42a7-ac3c-84b260728fbb

📥 Commits

Reviewing files that changed from the base of the PR and between 84c2589 and 534418d.

📒 Files selected for processing (1)
  • tsconfig.json

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ducksss
Ducksss merged commit e385318 into dev Jul 29, 2026
12 checks passed
@Ducksss
Ducksss deleted the fix/tsconfig-react-types-path branch July 29, 2026 16:10
Ducksss added a commit that referenced this pull request Jul 30, 2026
…'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]>
Ducksss added a commit that referenced this pull request Jul 30, 2026
…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.

This branch was successfully deployed

2 active deployments
Preview – payload-components-97bf — 534418dd Deployed Jul 29, 2026 by vercel[bot]
Preview – payload-components — 534418dd Deployed Jul 29, 2026 by vercel[bot]
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