Repository navigation
fix(plugin-utils): count every Next route file in the compiled set - #943
Merged
Merged
Conversation
computeCompiledFiles, the Next plugin's base CSS completion set, only started from App Router page files and added layouts and other segment files when a page sat below them. A Pages Router project therefore got an empty set, and the coordinator served its base CSS on the idle heuristic, which depends on traffic timing. Route handlers, a parallel-route default and a root not-found without a page were left out of App Router projects too. The compiled set now starts from every App Router route file (page, route, layout, template, default, loading, error, not-found, forbidden, unauthorized, global-error, global-not-found) and every Pages Router module under pages/, _app and _document included. computeFileRoutes, which drives atom hoisting, still counts only App Router pages. Refs #694 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:
|
8 of 17 tasks
12 of 14 tasks
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
감사 항목 NXT-03 (P1, NONDET) 수정입니다. Next 플러그인이 base CSS 완료 신호(
expectedBaseFiles)로 쓰는computeCompiledFiles는 App Router의page.*에서만 출발했습니다.layout같은 segment 파일은 그 아래에 page가 있을 때만 조상 shell로 들어갔습니다. 그래서 다음 문제가 있었습니다.pages/index.tsx,pages/about.tsx,_app,_document…)는 집합이 비어(expectedBaseFiles=[]), 코디네이터가 트래픽 타이밍에 의존하는 idle 휴리스틱으로 base CSS를 응답했습니다.route.ts), 아래에 page가 없는 parallel route@slot/default.tsx, page 없는 rootnot-found.tsx등이 빠졌습니다.변경:
page,route,layout,template,default,loading,error,not-found,forbidden,unauthorized,global-error,global-not-foundpages/아래의 모든 Pages Router 모듈 (_app,_document,_error,api/*포함, Next 기본pageExtensions인 tsx/ts/jsx/js)srcDir가src인 경우(src/pages)와 프로젝트 루트인 경우(pages, 기존sourceDir()가 선택) 모두 동작합니다.computeFileRoutes/computeFileReach는 그대로 App Routerpage만 셉니다. 이 PR은 완료 집합만 바꾸며, 이 함수는 Next 플러그인만 사용합니다.다른 PR과의 겹침
fix/plugin-core-update)가plugin-utils/src/import-graph.ts의 소스 확장자 / 루트 처리(jsFileRegex제거 등)를 바꿉니다. 이 PR은computeCompiledFiles와 route 정규식 근처만 수정해 직접 겹치지는 않지만, 같은 파일이라 텍스트 충돌 가능성이 있습니다. #934가 MDX /.mts등을 source 확장자로 넣으면 Pages Router 정규식의 확장자도 NextpageExtensions에 맞춰 함께 검토하는 것이 좋습니다.Test plan
bun test --coverage src/import-graph.test.ts(plugin-utils): 80 passsrc/pages/**(_app,_document,api, dynamic segment)와 그 import closure 포함, orphan 제외pages/(srcDir: cwd)route.ts,@modal/default.tsx, rootnot-found.tsx,global-error.tsx와 그 closure 포함plugin.test.ts,prewarm.test.ts(plugin-utils dist 재빌드 후)bunx tsc --noEmit -p packages/next-pluginbunx prettier --single-quote --no-semi --check(변경 파일)Refs #694
🤖 Generated with Claude Code