perf(s2-core): externalize lodash in UMD build to reduce bundle size#3267
Draft
perf(s2-core): externalize lodash in UMD build to reduce bundle size#3267
Conversation
# Conflicts: # packages/s2-core/src/facet/base-facet.ts
…header # Conflicts: # packages/s2-core/src/cell/header-cell.ts
# Conflicts: # packages/s2-core/package.json # packages/s2-core/src/sheet-type/spread-sheet.ts # pnpm-lock.yaml
…header # Conflicts: # packages/s2-core/src/cell/DataCellPool.ts # packages/s2-core/src/cell/header-cell.ts # packages/s2-core/src/facet/base-facet.ts
…_0718 # Conflicts: # packages/s2-core/src/group/grid-group.ts # packages/s2-core/src/utils/g-renders.ts # packages/s2-react/playground/components/BigDataSheet.tsx
…header # Conflicts: # packages/s2-core/src/cell/DataCellPool.ts # packages/s2-core/src/facet/base-facet.ts # packages/s2-core/src/utils/g-renders.ts
# Conflicts: # packages/s2-core/src/cell/col-cell.ts # packages/s2-core/src/cell/row-cell.ts # packages/s2-core/src/facet/header/base.ts # packages/s2-core/src/group/grid-group.ts # packages/s2-react/playground/components/BigDataSheet.tsx
This reverts commit 24cdae0.
Co-authored-by: Alexzjt <9548248+Alexzjt@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Analyze s2-core package size and optimization methods
perf(s2-core): externalize lodash in UMD build to reduce bundle size
Dec 25, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
s2-core UMD bundle was ~243KB brotli, exceeding the 240KB target. Root cause: full lodash library (~73KB minified) bundled due to 106
import { x } from 'lodash'imports.Changes
_Results
Breaking Change
UMD users must now include lodash separately:
ESM/CJS builds unchanged—lodash remains bundled inline.
Future Considerations
lodash-esfor ESM tree-shakingOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.