Repository navigation
perf(next-plugin): prewarm apps whose routes live at the project root - #898
Merged
Merged
Conversation
The import graph and production prewarm only scanned `src/`, so a Next app with `app/` or `pages/` at the root got an empty graph: nothing was prewarmed and the base CSS fell back to the 2.5 s idle wait under Turbopack. Read routes from wherever Next does (the root when it holds `app` or `pages`, `src` otherwise), and skip dot directories such as `.next` when listing sources so a root scan stays cheap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
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.
Summary
app/orpages/at the project root (Next's default layout, nosrc/) got an empty import graph: nothing was prewarmed,expectedBaseFileswas empty, and under Turbopack the base CSS request fell back to the 2.5 s idle wait on every production build.apporpages,srcotherwise.listSourceFilesskips dot directories (.next,.git,.turbo, …) so scanning the project root doesn't walk build output.Evidence
benchmark/next-stylex-turbo-devup-uiis the only Turbopack benchmark app with a rootapp/. It compiles ~1.8 s slower than the other devup-ui turbo rows in every run (1.42–1.57× tailwind-turbo), and this PR's benchmark row should show the drop.Test plan
bun test packages/plugin-utils(522 pass)bun test packages/next-plugin/src/__tests__/plugin.test.tsstylex-turbo-devup-ui)Refs #686
🤖 Generated with Claude Code