Skip to content

fix(devextreme): correctly replace state_manager for cjs#32389

Merged
chaosmirage merged 1 commit intoDevExpress:26_1from
chaosmirage:fix/state-manager-replacement-26-1
Feb 3, 2026
Merged

fix(devextreme): correctly replace state_manager for cjs#32389
chaosmirage merged 1 commit intoDevExpress:26_1from
chaosmirage:fix/state-manager-replacement-26-1

Conversation

@chaosmirage
Copy link
Contributor

cherry-pick #32386

@chaosmirage chaosmirage force-pushed the fix/state-manager-replacement-26-1 branch from 88a617e to 9a6dc48 Compare February 3, 2026 12:37
Copy link
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 adds CommonJS (CJS) support to the state manager module replacement process during the build. Previously, the build script would replace state manager index files with a simple ESM re-export (export * from './prod/index'), but this didn't work correctly for CJS modules. The fix detects CJS files and transpiles the ESM re-export to CJS format using Babel.

Changes:

  • Added CJS detection and transpilation logic to correctly replace state manager modules for both ESM and CJS builds
  • Improved error handling from console.error to proper callback-based error propagation
  • Added comprehensive test coverage for CJS path handling and transformation

Reviewed changes

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

File Description
packages/devextreme/build/gulp/state_manager/replace_state_manager_modules_for_production.js Added isCjsFile() and transpileToCjs() functions; updated error handling; reformatted entire file with double quotes (inconsistent with codebase convention)
packages/devextreme/build/gulp/state_manager/__tests__/build_state_manager.test.js Added test setup for CJS state manager directories and files; added assertions to verify CJS transformation produces correct CommonJS require syntax

@chaosmirage chaosmirage merged commit fab1f45 into DevExpress:26_1 Feb 3, 2026
114 of 115 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants