Skip to content

docs(core): document loaderFS option#5950

Open
killagu wants to merge 2 commits into
nextfrom
agent/egg-doc/4ce1c080
Open

docs(core): document loaderFS option#5950
killagu wants to merge 2 commits into
nextfrom
agent/egg-doc/4ce1c080

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented May 12, 2026

Summary

  • document the new loaderFS LoaderOptions entry in packages/core README
  • add English and Chinese site docs notes for loadToApp / loadToContext
  • refresh the core wiki page and log entry for the docs sync

Validation

  • git diff --check
  • pnpm run fmtcheck attempted, but oxfmt is not installed because node_modules is missing in this checkout

Summary by CodeRabbit

  • Documentation
    • Added and clarified LoaderOptions documentation to introduce the new loaderFS option, explaining how to customize the filesystem used for file discovery, stats, JSON reads, and module loading while preserving the existing default behavior. Updates published in English and Chinese docs and reflected in the project wiki and changelog for discoverability.

Review Change Stack

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

coderabbitai Bot commented May 12, 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: c09ba6f6-fe1e-41ce-9f20-01015cbee352

📥 Commits

Reviewing files that changed from the base of the PR and between ad33f24 and c8c8345.

📒 Files selected for processing (4)
  • packages/core/README.md
  • site/docs/advanced/loader.md
  • site/docs/zh-CN/advanced/loader.md
  • wiki/log.md
✅ Files skipped from review due to trivial changes (4)
  • packages/core/README.md
  • site/docs/zh-CN/advanced/loader.md
  • site/docs/advanced/loader.md
  • wiki/log.md

📝 Walkthrough

Walkthrough

This PR adds documentation for a new LoaderOptions.loaderFS option across the core README, English and Chinese site loader docs, and updates wiki log and core package wiki metadata to record the change.

Changes

LoaderFS Documentation Sync

Layer / File(s) Summary
Core and site LoaderOptions documentation
packages/core/README.md, site/docs/advanced/loader.md, site/docs/zh-CN/advanced/loader.md
Core package README adds loaderFS to the LoaderOptions parameter table, and both English and Chinese site documentation extend the LoaderOptions section with parameter description, explaining filesystem boundary customization for loadToApp/loadToContext and noting the default RealLoaderFS implementation.
Wiki log and metadata updates
wiki/log.md, wiki/packages/core.md
Wiki log is updated with a dated entry (2026-05-13) documenting the LoaderFS documentation sync, and the core package wiki page is refreshed with updated source file references and a note clarifying that loaderFS is now listed in public loader documentation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • eggjs/egg#5936: Main PR that introduces and exports the LoaderFS feature; this PR documents the new loaderFS LoaderOptions parameter added there.

Suggested reviewers

  • fengmk2

Poem

🐰 The docs now hop with clarity bright,
A new loaderFS path in sight,
From core to site, both East and West,
Wiki logs record the little quest,
Hooray — the loader docs are dressed!

🚥 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 'docs(core): document loaderFS option' is directly related to the main objective of the PR, which is adding documentation for the new loaderFS LoaderOptions entry across multiple documentation files (README, site docs in English and Chinese, and wiki pages).
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/4ce1c080

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 12, 2026

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: c8c8345
Status: ✅  Deploy successful!
Preview URL: https://164e547b.egg-cci.pages.dev
Branch Preview URL: https://agent-egg-doc-4ce1c080.egg-cci.pages.dev

View logs

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 syncs documentation across the core package README, the English/Chinese loader docs, and the internal wiki so that the public loaderFS LoaderOptions entry is discoverable and described consistently.

Changes:

  • Documented loaderFS in @eggjs/core LoaderOptions table.
  • Added loaderFS notes to the loader docs in both English and Chinese.
  • Updated the core wiki page metadata and appended a wiki log entry for the docs sync.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wiki/packages/core.md Adds additional doc/README sources and updates the page timestamp to reflect the docs sync.
wiki/log.md Adds a new wiki log entry recording the LoaderFS/loaderFS docs synchronization.
site/docs/advanced/loader.md Documents loaderFS in the LoaderOptions section for English site docs.
site/docs/zh-CN/advanced/loader.md Documents loaderFS in the LoaderOptions section for Chinese site docs.
packages/core/README.md Fixes/standardizes the LoaderOptions table formatting and adds the loaderFS row.

Comment thread wiki/log.md Outdated

## [2026-05-13] docs | sync LoaderFS loader option docs

- sources touched: `packages/core/src/loader/loader_fs.ts`, `packages/core/src/loader/file_loader.ts`, `packages/core/src/loader/egg_loader.ts`
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 documents the loaderFS option within LoaderOptions across the core README, site documentation (English and Chinese), and the project wiki. The changes also include formatting refinements to the existing documentation. Review feedback suggests including 'JSON reads' in the loaderFS description for technical accuracy and correcting several grammatical inconsistencies in the README's parameter table.

Comment thread site/docs/advanced/loader.md Outdated
Comment on lines +500 to +501
Customize the filesystem boundary used by `loadToApp` and `loadToContext` for file discovery, file stats, and module loading.
By default, Egg uses `RealLoaderFS`, which delegates to the local filesystem and keeps the existing runtime behavior.
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 description of loaderFS should include "JSON reads" for completeness, as the LoaderFS interface provides readJSON. Additionally, using backticks for function and class names improves readability and consistency with other parts of the documentation.

Suggested change
Customize the filesystem boundary used by `loadToApp` and `loadToContext` for file discovery, file stats, and module loading.
By default, Egg uses `RealLoaderFS`, which delegates to the local filesystem and keeps the existing runtime behavior.
Customize the filesystem boundary used by `loadToApp` and `loadToContext` for file discovery, file stats, JSON reads, and module loading.
By default, Egg uses `RealLoaderFS`, which delegates to the local filesystem and keeps the existing runtime behavior.

Comment thread site/docs/zh-CN/advanced/loader.md Outdated
Comment on lines +505 to +506
自定义 `loadToApp` 和 `loadToContext` 使用的文件系统边界,用于文件发现、文件状态读取和模块加载。
默认使用 `RealLoaderFS`,它会委托给本地文件系统,以保持现有运行时行为。
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

建议在 loaderFS 的描述中增加 "JSON 读取",以保持与英文文档和 LoaderFS 接口定义的一致性。同时,为函数和类名添加反引号以提高可读性。

Suggested change
自定义 `loadToApp``loadToContext` 使用的文件系统边界,用于文件发现、文件状态读取和模块加载
默认使用 `RealLoaderFS`,它会委托给本地文件系统,以保持现有运行时行为。
自定义 `loadToApp``loadToContext` 使用的文件系统边界,用于文件发现、文件状态读取、JSON 读取和模块加载
默认使用 `RealLoaderFS`,它会委托给本地文件系统,以保持现有运行时行为。

Comment thread packages/core/README.md Outdated
| target | `Object` | attach the target object from loaded files |
| match | `String/Array` | match the files when load, default to `**/*.js` (if `process.env.EGG_TYPESCRIPT` is true, default to `[ '**/*.(js\|ts)', '!**/*.d.ts' ]`) |
| ignore | `String/Array` | ignore the files when load |
| initializer | `Function` | custom file exports, receive two parameters, first is the inject object (if not js file, will be content buffer), second is an `options` object that contain `path` |
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

Fix grammar: "contain" should be "contains" when referring to the options object.

Suggested change
| initializer | `Function` | custom file exports, receive two parameters, first is the inject object (if not js file, will be content buffer), second is an `options` object that contain `path` |
| initializer | Function | custom file exports, receive two parameters, first is the inject object (if not js file, will be content buffer), second is an `options` object that contains `path` |

Comment thread packages/core/README.md Outdated
Comment on lines +237 to +238
| inject | `Object` | an object that be the argument when invoke the function |
| filter | `Function` | a function that filter the exports which can be loaded |
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

Improve the grammar for the inject and filter descriptions to make them more idiomatic and consistent with the rest of the table.

Suggested change
| inject | `Object` | an object that be the argument when invoke the function |
| filter | `Function` | a function that filter the exports which can be loaded |
| inject | Object | an object that is the argument when invoking the function |
| filter | Function | a function that filters the exports which can be loaded |

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.

🧹 Nitpick comments (1)
packages/core/README.md (1)

239-239: 💤 Low value

Minor inconsistency: loaderFS description mentions "JSON reads" but site docs omit it.

The loaderFS description here includes "JSON reads" in the list of capabilities ("file stats, JSON reads, and module loading"), but the corresponding documentation in site/docs/advanced/loader.md (line 500-501) and site/docs/zh-CN/advanced/loader.md (line 505-506) only mention "file stats, and module loading" without explicitly calling out JSON reads.

For consistency, consider either adding "JSON reads" to the site docs or removing it from this README if it's covered implicitly by "file stats" or "module loading".

🤖 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 `@packages/core/README.md` at line 239, The README entry for LoaderFS lists
"JSON reads" but the advanced loader docs (English and Chinese) omit it; update
the two advanced loader docs to include "JSON reads" in the capability list for
LoaderFS so the descriptions match, i.e., edit the advanced loader documentation
pages to add "JSON reads" alongside "file stats" and "module loading" where
LoaderFS is described (referencing the LoaderFS symbol/section) to keep both
languages consistent.
🤖 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.

Nitpick comments:
In `@packages/core/README.md`:
- Line 239: The README entry for LoaderFS lists "JSON reads" but the advanced
loader docs (English and Chinese) omit it; update the two advanced loader docs
to include "JSON reads" in the capability list for LoaderFS so the descriptions
match, i.e., edit the advanced loader documentation pages to add "JSON reads"
alongside "file stats" and "module loading" where LoaderFS is described
(referencing the LoaderFS symbol/section) to keep both languages consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f97824d1-ced4-4756-85dd-c41d7bad11cf

📥 Commits

Reviewing files that changed from the base of the PR and between 0dec2c9 and ad33f24.

📒 Files selected for processing (5)
  • packages/core/README.md
  • site/docs/advanced/loader.md
  • site/docs/zh-CN/advanced/loader.md
  • wiki/log.md
  • wiki/packages/core.md

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

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

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: c8c8345
Status: ✅  Deploy successful!
Preview URL: https://fcf6cbc6.egg-v3.pages.dev
Branch Preview URL: https://agent-egg-doc-4ce1c080.egg-v3.pages.dev

View logs

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