Skip to content

Comments

Include frameworks in main-app (#41465)#3

Open
MitchLewis930 wants to merge 1 commit intopr_033_beforefrom
pr_033_after
Open

Include frameworks in main-app (#41465)#3
MitchLewis930 wants to merge 1 commit intopr_033_beforefrom
pr_033_after

Conversation

@MitchLewis930
Copy link

@MitchLewis930 MitchLewis930 commented Jan 30, 2026

PR_033

Summary by CodeRabbit

  • Chores
    • Updated build bundling rules to keep app-specific bundles separate from framework cache, improving cache behavior and load performance.
    • Refined chunk grouping logic to better separate framework and app code, aiming for more efficient builds and optimized client-side loading.

There is no need to have a separate `framework` chunk for React and React DOM, as they're already included in the `main-app` entry. With this PR, React and React DOM will be included in `main-app` directly and app is no longer depending on the `framework` chunk.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

The PR adjusts webpack splitChunks in packages/next/build/webpack-config.ts to exclude main-app, app-internals, and app/* chunks from the framework cache group when hasAppDir is enabled, keeping app-related chunks out of the framework grouping.

Changes

Cohort / File(s) Summary
Webpack Split Chunks Configuration
packages/next/build/webpack-config.ts
Adds main-app to top-level splitChunks exclusion; replaces static chunks: 'all'/boolean rule for the framework cache group with a dynamic function that skips bundling main-app, app-internals, and app/* chunks when hasAppDir is true.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through chunks both big and small,
Skipped the app bits from the framework hall,
Main-app stayed cozy, internals too,
Webpack hummed softly — a cleaner view! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 3
❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Include frameworks in main-app' is related to the changeset but appears misleading. The summary shows changes exclude main-app from framework grouping, the opposite of what the title suggests. Clarify the title to accurately reflect that main-app is being excluded from the framework cache group, not included in frameworks.
Description check ⚠️ Warning The PR description is severely incomplete, containing only 'PR_033' with no meaningful details, objectives, rationale, or adherence to the template structure. Provide a comprehensive description following the template: explain what changed, why it's needed, and how it was implemented. Link related issues and add context for reviewers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into pr_033_before

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pr_033_after

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7be2ef0 and a75b323.

📒 Files selected for processing (1)
  • packages/next/build/webpack-config.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/next/build/webpack-config.ts (1)
test/integration/relay-analytics/pages/_app.js (1)
  • name (12-12)
🔇 Additional comments (2)
packages/next/build/webpack-config.ts (2)

1340-1341: Nice safeguard to keep main-app unsplit.
This exclusion aligns with the existing intent to avoid vendor splitting for core runtime chunks.


1344-1359: Good app-dir isolation in the framework cache group.
Skipping main-app/app-internals/app/* when hasAppDir is enabled matches the stated intent and keeps app chunks out of the framework bundle.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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

@MitchLewis930
Copy link
Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

✅ Actions performed

Full review triggered.

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