Skip to content

docs(wiki): sync bundled runtime support notes#5929

Merged
killagu merged 2 commits intonextfrom
agent/egg-doc/e3a2c930
May 6, 2026
Merged

docs(wiki): sync bundled runtime support notes#5929
killagu merged 2 commits intonextfrom
agent/egg-doc/e3a2c930

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented May 5, 2026

Summary

  • Add wiki pages for @eggjs/utils bundled module-loader behavior and @eggjs/onerror local error handler implementation.
  • Update the egg-bundler wiki source metadata and add the daily wiki log entry for the new bundled runtime support changes.

Validation

  • git diff --check
  • pnpm exec oxfmt --check wiki/index.md wiki/log.md wiki/packages/egg-bundler.md wiki/packages/utils.md wiki/packages/onerror.md

Note: pnpm install --no-frozen-lockfile was needed in this fresh worktree to make oxfmt available. The markdown-only pre-commit hook was bypassed because oxlint --type-aware --fix exits with No files found to lint for this docs-only file set.

Summary by CodeRabbit

  • Documentation
    • Added documentation for the Onerror Plugin, describing configurable error response handlers (HTML, text, JSON, JS, redirect) and override options.
    • Added documentation for the Utils Package, describing public helper APIs and bundled module-loading behavior.
    • Updated package metadata and wiki package docs.
    • Clarified wiki dates use the workspace-local Asia/Shanghai calendar and added a log entry for recent updates.
    • Updated plugin README: renamed jsonp config to js.

Copilot AI review requested due to automatic review settings May 5, 2026 18:06
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 13e52278-f3fd-4f78-b5ac-20a891b7fdd9

📥 Commits

Reviewing files that changed from the base of the PR and between 85bc09a and 191dfed.

📒 Files selected for processing (4)
  • AGENTS.md
  • plugins/onerror/README.md
  • wiki/log.md
  • wiki/packages/onerror.md
✅ Files skipped from review due to trivial changes (3)
  • plugins/onerror/README.md
  • AGENTS.md
  • wiki/log.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • wiki/packages/onerror.md

📝 Walkthrough

Walkthrough

Adds and updates wiki documentation: new package pages for @eggjs/onerror and @eggjs/utils, index navigation entries, a log entry (2026-05-06) documenting bundled runtime support changes, and an egg-bundler metadata update referencing ExternalsResolver and a refreshed updated_at timestamp.

Changes

Wiki documentation and metadata

Layer / File(s) Summary
Log / Dates
wiki/log.md, AGENTS.md
Adds a 2026-05-06 log entry describing "package
Package Pages (frontmatter + content)
wiki/packages/onerror.md, wiki/packages/utils.md
Adds onerror.md (frontmatter, plugin description, supported handlers, config options, local onerror implementation and default HTML rendering via ErrorView) and utils.md (frontmatter, public APIs list, bundle loader/globalThis hook behavior, and opaque native dynamic import via new Function).
Index / Navigation
wiki/index.md
Expands "## Packages" list to include links to the Onerror Plugin and Utils Package (Typings Package remains present).
Package metadata
wiki/packages/egg-bundler.md
Updates frontmatter: adds tools/egg-bundler/src/lib/ExternalsResolver.ts to source_files and bumps updated_at to 2026-05-06.
Plugin README minor option rename
plugins/onerror/README.md
Replaces jsonp option entry with js (customize JSONP error handler) in the Usage options list.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • eggjs/egg#5903: Documents the same utils API (setBundleModuleLoader and global loader behavior) referenced by these wiki changes.
  • eggjs/egg#5927: Introduces the local onerror implementation that the onerror docs describe.
  • eggjs/egg#5889: Changes ExternalsResolver behavior related to the egg-bundler metadata update.

Suggested reviewers

  • fengmk2
  • gxkl
  • akitaSummer

"I hopped through pages, nibbling text with glee,
Docs for onerror and utils now hang on the tree,
Dates set to Shanghai, bundler notes in a line,
ExternalsResolver pointed, navigation aligned,
A rabbit's small cheer — well-documented and fine!" 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—documentation updates synchronizing bundled runtime support notes across wiki pages (utils package, onerror plugin, and egg-bundler metadata).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/egg-doc/e3a2c930

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

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 191dfed
Status: ✅  Deploy successful!
Preview URL: https://5ec29d11.egg-cci.pages.dev
Branch Preview URL: https://agent-egg-doc-e3a2c930.egg-cci.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the project's wiki by adding documentation for the Onerror Plugin and Utils Package, and updating the Egg Bundler documentation. These updates detail the implementation of local error handling to support static bundling and the mechanism for shared module loading. Feedback was provided to ensure the documentation for the Onerror Plugin accurately reflects the configuration keys used in the source code, specifically regarding JSONP support.

Comment thread wiki/packages/onerror.md Outdated
# Onerror Plugin

`@eggjs/onerror` is the default Egg error-handling plugin. It installs
`ctx.onerror` and supports configurable handlers for HTML, text, JSON, JSONP,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The implementation in plugins/onerror/src/lib/onerror.ts uses the key js for JSONP support. It is better to refer to it as JS (JSONP) to align with the code while maintaining the conceptual name.

Suggested change
`ctx.onerror` and supports configurable handlers for HTML, text, JSON, JSONP,
`ctx.onerror` and supports configurable handlers for HTML, text, JSON, JS (JSONP),

Comment thread wiki/packages/onerror.md Outdated

- `errorPageUrl` redirects production HTML requests after unexpected errors.
- `accepts` customizes content negotiation.
- `all`, `html`, `text`, `json`, and `jsonp` customize response handling for
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The configuration key used in the OnerrorOptions interface and the content negotiation logic in plugins/onerror/src/lib/onerror.ts is js, not jsonp. This should be updated to match the implementation to avoid configuration errors.

Suggested change
- `all`, `html`, `text`, `json`, and `jsonp` customize response handling for
- `all`, `html`, `text`, `json`, and `js` customize response handling for

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository wiki to document recently discovered “bundled runtime support” behaviors across @eggjs/utils, @eggjs/onerror, and @eggjs/egg-bundler, and records the update in the wiki change log.

Changes:

  • Add new wiki package pages for @eggjs/utils (bundled module-loader hook behavior) and @eggjs/onerror (local onerror() implementation rationale).
  • Update the Egg Bundler wiki page metadata to include ExternalsResolver.ts.
  • Append a new entry to wiki/log.md and link the new package pages from wiki/index.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
wiki/packages/utils.md New wiki page describing @eggjs/utils public surfaces and bundled module-loading behavior.
wiki/packages/onerror.md New wiki page describing @eggjs/onerror configuration and local error handler implementation details.
wiki/packages/egg-bundler.md Adds ExternalsResolver.ts to wiki “source_files” metadata and updates updated_at.
wiki/log.md Adds a new wiki log entry for the bundled runtime support documentation update.
wiki/index.md Links the newly added onerror and utils wiki pages from the package index.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wiki/log.md`:
- Line 3: Update the log entry date on the second line in wiki/log.md from
"2026-05-06" to the actual PR date "2026-05-05" (or alternatively add an
explicit note that dates are UTC) so the entry aligns with the PR timestamp and
avoids a future-dated record; locate the string "## [2026-05-06] package | sync
bundled runtime support changes" and replace the date portion or append a UTC
dating note to that header.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 28375593-8baf-448b-80e2-7df4297dd853

📥 Commits

Reviewing files that changed from the base of the PR and between aca1168 and 85bc09a.

📒 Files selected for processing (5)
  • wiki/index.md
  • wiki/log.md
  • wiki/packages/egg-bundler.md
  • wiki/packages/onerror.md
  • wiki/packages/utils.md

Comment thread wiki/log.md
@@ -1,5 +1,11 @@
# Wiki Log

## [2026-05-06] package | sync bundled runtime support changes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use a non-future log date to avoid chronology drift.

Line 3 records 2026-05-06, but this PR is dated 2026-05-05 (2026-05-05T18:06:51Z). Please align to the actual entry date (or explicitly document UTC-based dating) so the log and package updated_at fields don’t appear future-dated.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wiki/log.md` at line 3, Update the log entry date on the second line in
wiki/log.md from "2026-05-06" to the actual PR date "2026-05-05" (or
alternatively add an explicit note that dates are UTC) so the entry aligns with
the PR timestamp and avoids a future-dated record; locate the string "##
[2026-05-06] package | sync bundled runtime support changes" and replace the
date portion or append a UTC dating note to that header.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 5, 2026

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 191dfed
Status: ✅  Deploy successful!
Preview URL: https://4315a9aa.egg-v3.pages.dev
Branch Preview URL: https://agent-egg-doc-e3a2c930.egg-v3.pages.dev

View logs

@killagu killagu merged commit 0389f2d into next May 6, 2026
10 checks passed
@killagu killagu deleted the agent/egg-doc/e3a2c930 branch May 6, 2026 05:56
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.

3 participants