Skip to content

Docs/fix lodash import: saved 15kB of import size#4318

Merged
ljosberinn merged 2 commits intochakra-ui:mainfrom
tomchentw:docs/fix-lodash-import
Jul 6, 2021
Merged

Docs/fix lodash import: saved 15kB of import size#4318
ljosberinn merged 2 commits intochakra-ui:mainfrom
tomchentw:docs/fix-lodash-import

Conversation

@tomchentw
Copy link
Copy Markdown
Contributor

📝 Description

Change the lodash imports to import individual functions inside the package :)
This saves 15kB of not importing the whole lodash (since its index.js is CJS bundle.)

out

793kB -> 778kB (-1.9%)

⛳️ Current behavior (updates)

import _ from "lodash"

🚀 New behavior

import capitalize from "lodash/capitalize"

💣 Is this a breaking change (Yes/No):

No.

📝 Additional Information

Originally from #4292 (comment)

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 2, 2021

⚠️ No Changeset found

Latest commit: 387538e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 2, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui/ATeeasByUwdkveuu7wEtYTj7wbME
✅ Preview: https://chakra-ui-git-fork-tomchentw-docs-fix-lodash-import-chakra-ui.vercel.app

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Jul 2, 2021

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 387538e:

Sandbox Source
create-react-app-ts Configuration

@tomchentw
Copy link
Copy Markdown
Contributor Author

@ljosberinn is there anything I could do to merge this?

@ljosberinn ljosberinn merged commit ae27d4f into chakra-ui:main Jul 6, 2021
@ljosberinn
Copy link
Copy Markdown
Contributor

sorry I'm not really involved with managing the repo at this time but considering all tests have passed and its quite clear this works as expected we can safely go ahead here :)

@tomchentw tomchentw deleted the docs/fix-lodash-import branch July 6, 2021 15:22
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.

2 participants