You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(module): group setup into sections and trim comments - #3930
src/module.ts was hard to read: setup() mixed server, browser and build steps, and many comments repeated the code or ran over several lines.
setup() is grouped into sections with one-line headers: Options, Entry files, Build config, Server, Browser, Components, Dev HMR, v3 compatibility, Types, then Media (skipped in prepare).
app/content.ts is resolved next to the server/content.ts entry, as appContentPath (string | undefined) instead of the hasAppContent boolean. contentPath is renamed to serverContentPath to match.
The #content-wasm-plugins alias moved to the browser section.
Comments that restated the code are removed. The others are rewritten to one sentence per line.
No behavior change. The diff only moves code, renames two locals and edits comments.
Evidence
The same checks as CI, run locally on this branch: pnpm dev:prepare, pnpm lint, pnpm prepack and pnpm typecheck pass. vitest run --maxWorkers 1 --no-file-parallelism passes 28 test files and 112 tests.
Notes
The app/content.ts warning (hybrid mode with compatibilityVersion: 4 only) is now logged before the server content is set up instead of after.
ELI5
The file that sets up the module did a lot of steps in a confusing order. This puts the steps into labeled groups and shortens the comments, so it's easier to read. The module works exactly as before.
🤖 Generated with Amp, reviewed by @larbish before opening.
No actionable comments were generated in the recent review.
Walkthrough
The module resolves server and browser content entries separately. It accepts app/content.ts only in hybrid mode with compatibility version 4; otherwise, it warns and uses the mode-specific browser runtime. The WASM-plugin alias is configured during browser setup. Other changes revise comments and headings. The existing type-generation, prepare-mode, prerender, and media logic remains unchanged.
This is a refactor of module setup with no intended behavior change. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "refactor(module): group setup into sections and trim comments" matches the change. The PR regroups the setup() steps in src/module.ts into labelled sections and shortens comments, as the su…
Description check
The description matches the changeset. It explains that setup() is grouped into labelled sections, that app/content.ts is resolved as appContentPath instead of hasAppContent, that contentPath is renam…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "refactor(module): group setup into sections and trim comments" matches the change. The PR regroups the setup() steps in src/module.ts into labelled sections and shortens comments, as the summary and objectives describe. It also omits the renames (contentPath to serverContentPath, hasAppContent to appContentPath), which is acceptable because the title need not list every detail.
Full details: Description check
Explanation
The description matches the changeset. It explains that setup() is grouped into labelled sections, that app/content.ts is resolved as appContentPath instead of hasAppContent, that contentPath is renamed to serverContentPath, that the #content-wasm-plugins alias moved to the browser section, and that comments were removed or rewritten. It also lists the checks run locally.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 7d38918e-9246-42b4-b4ca-db856534f2c2
Commits
Reviewing files that changed from the base of the PR and between 1e99a5a and 8128038.
Files selected for processing: 1
src/module.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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
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.
📚 Description
src/module.tswas hard to read:setup()mixed server, browser and build steps, and many comments repeated the code or ran over several lines.setup()is grouped into sections with one-line headers: Options, Entry files, Build config, Server, Browser, Components, Dev HMR, v3 compatibility, Types, then Media (skipped in prepare).app/content.tsis resolved next to theserver/content.tsentry, asappContentPath(string | undefined) instead of thehasAppContentboolean.contentPathis renamed toserverContentPathto match.#content-wasm-pluginsalias moved to the browser section.No behavior change. The diff only moves code, renames two locals and edits comments.
Evidence
The same checks as CI, run locally on this branch:
pnpm dev:prepare,pnpm lint,pnpm prepackandpnpm typecheckpass.vitest run --maxWorkers 1 --no-file-parallelismpasses 28 test files and 112 tests.Notes
The
app/content.tswarning (hybrid mode withcompatibilityVersion: 4only) is now logged before the server content is set up instead of after.ELI5
The file that sets up the module did a lot of steps in a confusing order. This puts the steps into labeled groups and shortens the comments, so it's easier to read. The module works exactly as before.
🤖 Generated with Amp, reviewed by @larbish before opening.