Skip to content

refactor(module): group setup into sections and trim comments - #3930

Merged
farnabaz merged 1 commit into
v4from
refactor/module-setup-sections
Nov 25, 2026
Merged

farnabaz merged 1 commit into
v4from
refactor/module-setup-sections

Conversation

@larbish

@larbish larbish commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

📚 Description

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.

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
content Error Error Nov 25, 2026 1:18pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Explain Change →

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.

Estimated code review effort: 2 (Simple) | ~12 minutes

Merge Risk: Minimal · up to 81280

This is a refactor of module setup with no intended behavior change. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • 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.

@farnabaz
farnabaz merged commit eaf5fef into v4 Nov 25, 2026
6 of 7 checks passed
@farnabaz
farnabaz deleted the refactor/module-setup-sections branch November 25, 2026 13:22

This branch had an error being deployed

1 failed deployment
Preview — 81280381 Deployed Nov 25, 2026 by vercel[bot]
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