Include frameworks in main-app (#41465)#3
Open
MitchLewis930 wants to merge 1 commit intopr_033_beforefrom
Open
Include frameworks in main-app (#41465)#3MitchLewis930 wants to merge 1 commit intopr_033_beforefrom
MitchLewis930 wants to merge 1 commit intopr_033_beforefrom
Conversation
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)
Greptile OverviewGreptile SummaryModified webpack splitChunks configuration to bundle framework dependencies (React/ReactDOM) directly into Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant WC as Webpack Config
participant SC as SplitChunks Plugin
participant FC as Framework CacheGroup
participant Chunks as Chunk Output
WC->>SC: Configure splitChunks optimization
SC->>SC: Evaluate chunks function
SC->>SC: Exclude polyfills, main, main-app, pages/_app
alt hasAppDir is true
SC->>FC: Evaluate framework cacheGroup
FC->>FC: Check chunk name
alt chunk is main-app, app-internals, or app/*
FC->>FC: Return false (exclude from framework chunk)
FC->>Chunks: Include in main-app bundle
else chunk is not app-related
FC->>FC: Return true (include in framework chunk)
FC->>Chunks: Extract to separate framework chunk
end
else hasAppDir is false
SC->>FC: Use all chunks for framework
FC->>Chunks: Extract all framework deps to separate chunk
end
|
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.
PR_033