Skip to content

Deduplicate imports - #5128

Merged
markerikson merged 2 commits into
masterfrom
feature/deduplicate-imports-2
Nov 3, 2025
Merged

markerikson merged 2 commits into
masterfrom
feature/deduplicate-imports-2

Conversation

@markerikson

Copy link
Copy Markdown
Collaborator

This PR:

  • Deduplicates all external imports from Immer, Reselect, React, and React-Redux, to work around ESBuild not deduplicating them when it bundles

This should shave a few hundred bytes off the prod artifacts, although not sure how much actually applies in built apps.

Example of the differences:

image

@codesandbox

codesandbox Bot commented Nov 3, 2025

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web Editor β€’ VS Code β€’ Insiders

Open Preview

@codesandbox-ci

codesandbox-ci Bot commented Nov 3, 2025

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5eeaebd:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@netlify

netlify Bot commented Nov 3, 2025

Copy link
Copy Markdown

βœ… Deploy Preview for redux-starter-kit-docs ready!

Name Link
πŸ”¨ Latest commit 5eeaebd
πŸ” Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/6908121a338be50008dc0a9e
😎 Deploy Preview https://deploy-preview-5128--redux-starter-kit-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Nov 3, 2025

Copy link
Copy Markdown

size-limit report πŸ“¦

Path Size
1. entry point: @reduxjs/toolkit (cjs, production.min.cjs) 14.47 KB (-0.36% πŸ”½)
1. entry point: @reduxjs/toolkit/react (cjs, production.min.cjs) 14.6 KB (-0.49% πŸ”½)
1. entry point: @reduxjs/toolkit/query (cjs, production.min.cjs) 24.62 KB (-0.31% πŸ”½)
1. entry point: @reduxjs/toolkit/query/react (cjs, production.min.cjs) 26.95 KB (-0.25% πŸ”½)
2. entry point: @reduxjs/toolkit (without dependencies) (cjs, production.min.cjs) 7.69 KB (-0.7% πŸ”½)
2. entry point: @reduxjs/toolkit/query (without dependencies) (cjs, production.min.cjs) 11.15 KB (-0.23% πŸ”½)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (cjs, production.min.cjs) 3 KB (-1.07% πŸ”½)
3. configureStore (.modern.mjs) 4.31 KB (-0.63% πŸ”½)
3. combineSlices (.modern.mjs) 3.68 KB (+0.7% πŸ”Ί)
3. createListenerMiddleware (.modern.mjs) 4.63 KB (+0.26% πŸ”Ί)

@markerikson
markerikson merged commit 952e7ed into master Nov 3, 2025
@aryaemami59
aryaemami59 deleted the feature/deduplicate-imports-2 branch March 18, 2026 07:54
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