Skip to content

refactor: load config with shared config loader package#1

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/pr-updates
Jul 9, 2026
Merged

refactor: load config with shared config loader package#1
chenjiahan merged 1 commit into
mainfrom
chenjiahan/pr-updates

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

This PR switches Rstack config loading to @rstackjs/load-config so user config resolution can use the shared Rstack loader instead of the Rsbuild loader. It adds the package to the workspace catalog, keeps jiti external in the CLI bundle, and updates the spelling dictionary for the new package scope.

@chenjiahan chenjiahan changed the title fix: load config with rstackjs loader fix: load config with shared config loader package Jul 9, 2026
@chenjiahan chenjiahan changed the title fix: load config with shared config loader package refactor: load config with shared config loader package Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: d05ba6bd-76ce-41e9-aa63-53ec5fbb7dc8

📥 Commits

Reviewing files that changed from the base of the PR and between 4ce72af and e61adc0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • package.json
  • packages/rstack/rslib.config.ts
  • packages/rstack/src/config.ts
  • pnpm-workspace.yaml
  • scripts/dictionary.txt

📝 Walkthrough

Walkthrough

This change adds @rstackjs/load-config as a new dependency, registering it in the pnpm workspace catalog with version ^0.1.1 and adding it to package.json devDependencies. The minimumReleaseAgeExclude list is extended to exempt @rstackjs/* packages. In packages/rstack/rslib.config.ts, an output.externals entry for jiti is added. In packages/rstack/src/config.ts, the RsbuildConfigDefinition import is separated into a type-only import. A custom dictionary entry rstackjs is added to scripts/dictionary.txt.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@chenjiahan chenjiahan merged commit d74b565 into main Jul 9, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e61adc00a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,4 +1,5 @@
import { loadConfig, type RsbuildConfigDefinition } from '@rsbuild/core';
import { loadConfig } from '@rstackjs/load-config';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve fresh config imports

Switching loadRstackConfig() to @rstackjs/load-config changes the cache behavior unless fresh: true is passed: the new loader defaults to reusing the native module cache, while the previous Rsbuild loader always bypassed it. Because loadRstackConfig() clears state.configs after each call, any second config load in the same CLI process, such as a dev-server restart/config reload, will not re-execute the user's define.* calls and will return an empty config. Please pass fresh: true in the loadConfig options to preserve the previous behavior.

Useful? React with 👍 / 👎.

@chenjiahan chenjiahan deleted the chenjiahan/pr-updates branch July 10, 2026 02:39
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.

1 participant