Skip to content

fix(deps): update dependency reduce-configs to v2#58

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/reduce-configs-2.x
Open

fix(deps): update dependency reduce-configs to v2#58
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/reduce-configs-2.x

Conversation

@renovate

@renovate renovate Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
reduce-configs ^1.1.2^2.0.1 age confidence

Release Notes

rstackjs/reduce-configs (reduce-configs)

v2.0.1

Compare Source

What's Changed

Full Changelog: rstackjs/reduce-configs@v2.0.0...v2.0.1

v2.0.0

Compare Source

Breaking Changes

  • This package is now a pure ESM package.
  • reduceConfigs and reduceConfigsWithContext now return Promise<T>.
  • reduceConfigsAsyncWithContext, reduceConfigsMergeContext has been removed.

What's Changed

Full Changelog: rstackjs/reduce-configs@v1.1.2...v2.0.0


Configuration

📅 Schedule: (in timezone Asia/Shanghai)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, on day 1 and 15 of the month (* 0-3 1,15 * *)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/reduce-configs-2.x branch 2 times, most recently from 0bbff75 to 4ef2ac2 Compare June 6, 2026 04:36
@renovate renovate Bot force-pushed the renovate/reduce-configs-2.x branch from 4ef2ac2 to 00513c3 Compare June 11, 2026 20:14
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates the reduce-configs dependency in package.json from ^1.1.2 to ^2.0.1. The change involves a major version bump that may introduce breaking changes. No other dependencies, scripts, or package configuration are modified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(deps): update dependency reduce-configs to v2' directly and clearly summarizes the main change: updating the reduce-configs dependency to version 2.
Description check ✅ Passed The description is related to the changeset, providing detailed release notes, version comparison, and dependency update information for the reduce-configs v2 upgrade.
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 renovate/reduce-configs-2.x

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

@coderabbitai coderabbitai 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.

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 `@package.json`:
- Line 31: reduceConfigs v2 returns a Promise but applyCSSMinimizer in
src/index.ts treats it synchronously and passes a Promise into
CssMinimizerWebpackPlugin; change applyCSSMinimizer to be async, await
reduceConfigs(...) to produce mergedOptions, and update all call sites (notably
the api.modifyBundlerChain(...) callback) to await applyCSSMinimizer(chain,
CHAIN_ID, options) so CssMinimizerWebpackPlugin receives the resolved
CssMinimizerPluginOptions rather than a Promise.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 21ad1315-de54-495d-bc81-cfef9c9151e2

📥 Commits

Reviewing files that changed from the base of the PR and between b01d713 and 00513c3.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json

Comment thread package.json
"dependencies": {
"css-minimizer-webpack-plugin": "^8.0.0",
"reduce-configs": "^1.1.2"
"reduce-configs": "^2.0.1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Find all usages of reduceConfigs and applyCSSMinimizer to assess migration scope

echo "=== Searching for reduceConfigs usage ==="
rg -n --type=ts --type=js -A 3 -B 3 '\breduceConfigs\s*\('

echo ""
echo "=== Searching for applyCSSMinimizer calls to identify what needs async updates ==="
rg -n --type=ts --type=js -A 3 -B 3 '\bapplyCSSMinimizer\s*\('

echo ""
echo "=== Checking for other reduce-configs APIs that might be affected ==="
rg -n --type=ts --type=js 'from ["\']reduce-configs["\']'

Repository: rstackjs/rsbuild-plugin-css-minimizer

Length of output: 1289


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== package.json (lines around type + reduce-configs) ==="
if [ -f package.json ]; then
  # Print a small window around "reduce-configs" and "type"
  rg -n '"type"' package.json
  rg -n '"reduce-configs"' package.json
  echo "--- context around reduce-configs ---"
  rg -n -C 5 '"reduce-configs"' package.json
  echo "--- context around type ---"
  rg -n -C 5 '"type"' package.json
else
  echo "package.json not found"
fi

echo
echo "=== src/index.ts (applyCSSMinimizer + reduceConfigs usage) ==="
if [ -f src/index.ts ]; then
  rg -n 'export function applyCSSMinimizer|reduceConfigs\s*\(' src/index.ts
  echo "--- lines 1-130 ---"
  sed -n '1,130p' src/index.ts
else
  echo "src/index.ts not found"
fi

echo
echo "=== Search for reduce-configs import(s) and other APIs ==="
# Robustly search for any reduce-configs named imports/usage
rg -n --type=ts --type=js 'from\s+["'\'']reduce-configs["'\'']' .
rg -n --type=ts --type=js '\breduceConfigs(WithContext|AsyncWithContext|MergeContext)?\b' src

Repository: rstackjs/rsbuild-plugin-css-minimizer

Length of output: 3715


🌐 Web query:

reduce-configs v2.0.0 reduceConfigs return type Promise

💡 Result:

In version 2.0.0 and later of the reduce-configs package, the reduceConfigs function returns a Promise [1][2]. This change was introduced to make configuration reducers asynchronous, allowing them to handle both synchronous and asynchronous operations [1]. As part of this update, the API was simplified by removing the older synchronous/asynchronous split, meaning that reduceConfigs now consistently returns a promise regardless of whether the provided configuration callbacks return a value, void, or a promise [1].

Citations:


Critical: reduceConfigs v2 is async, but applyCSSMinimizer uses it synchronously.

reduce-configs@^2.0.1 makes reduceConfigs return Promise<T>, but src/index.ts assigns it directly to mergedOptions in a non-async applyCSSMinimizer and passes that promise into CssMinimizerWebpackPlugin options.

Required fix: make applyCSSMinimizer async, await reduceConfigs, and await the call site.

export async function applyCSSMinimizer(
  chain: RspackChain,
  CHAIN_ID: ChainIdentifier,
  options: PluginCssMinimizerOptions = {},
): Promise<void> {
  const mergedOptions: CssMinimizerPluginOptions = await reduceConfigs({
    initial: {
      minify: CssMinimizerWebpackPlugin.cssnanoMinify,
      minimizerOptions: getCssnanoDefaultOptions(),
    },
    config: options.pluginOptions,
  });

  chain.optimization
    .minimizer(CHAIN_ID.MINIMIZER.CSS)
    .use(CssMinimizerWebpackPlugin as Rspack.RspackPluginInstance, [
      mergedOptions,
    ])
    .end();
}

Then update the call inside api.modifyBundlerChain(async ...):

await applyCSSMinimizer(chain, CHAIN_ID, options);
🤖 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 `@package.json` at line 31, reduceConfigs v2 returns a Promise but
applyCSSMinimizer in src/index.ts treats it synchronously and passes a Promise
into CssMinimizerWebpackPlugin; change applyCSSMinimizer to be async, await
reduceConfigs(...) to produce mergedOptions, and update all call sites (notably
the api.modifyBundlerChain(...) callback) to await applyCSSMinimizer(chain,
CHAIN_ID, options) so CssMinimizerWebpackPlugin receives the resolved
CssMinimizerPluginOptions rather than a Promise.

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.

0 participants