[pull] master from cube-js:master#440
Merged
pull[bot] merged 4 commits intocode:masterfrom May 1, 2026
Merged
Conversation
…subpath (#10796) Two regressions made @cubejs-client/core unusable from CommonJS under strict resolvers (Yarn PnP, pnpm). Loose node_modules layouts masked both via hoisting. Bug 1: main CJS bundle requires @babel/runtime but doesn't declare it. The rollup config applies @babel/plugin-transform-runtime with helpers: true to the CJS/UMD outputs, which rewrites Babel helpers into `require('@babel/runtime/helpers/*')` calls. PR #5917 (v0.31.34) declared @babel/runtime in dependencies for exactly this reason. The TS migration in #9562 removed that declaration on the assumption that tsc was now the only build, missing that rollup still produces the CJS/UMD bundles and still externalizes helpers. Fix: switch the rollup babel plugin to `babelHelpers: 'bundled'` and drop @babel/plugin-transform-runtime. Helpers are now inlined into each bundle (CJS bundle grows ~1KB), and the package no longer has an undeclared runtime dependency. Same change applies to the ws-transport, react, and vue3 bundles built from the same config. Bug 2: `@cubejs-client/core/format` is unreachable from CommonJS. The ./format exports map has only `import` (ESM), no `require`, and formatValue is intentionally not re-exported from the main entry to avoid bloating the CJS/UMD bundles with d3-format/d3-time-format. As a result `require('@cubejs-client/core/format')` fails with "Package subpath './format' is not defined". Fix: add a dedicated CJS bundle at dist/format.cjs (rollup, with d3-format/d3-time-format inlined since both are ESM-only and can't be required) and add a `require` condition to the ./format exports. ESM consumers continue to get dist/src/format.js (tree-shakable, deps externalized); CJS consumers now get a self-contained 50KB bundle. The main entry is unchanged — no size regression for users who don't import ./format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )