🎯 Summary
Remove lodash and @types/lodash packages from the project and replace all usages with native JavaScript/TypeScript equivalents.
💡 Motivation
- 📦 Lodash adds unnecessary bundle weight; modern JS/TS covers most of its utilities natively.
- 🔒 Reduces the dependency surface and simplifies maintenance.
- 🌲 Improves tree-shaking and overall bundle size.
📂 Affected files
🗂️ Dependencies (packages/react-components/package.json)
lodash ^4.17.21
@types/lodash ^4.17.21
📄 Source files using lodash
⚙️ Reducers
src/reducers/AddressReducer.ts
src/reducers/PlaceOrderReducer.ts
src/reducers/GiftCardReducer.ts
src/reducers/OrderReducer.ts
🧩 Components
src/components/payment_gateways/StripeGateway.tsx
src/components/payment_gateways/ExternalGateway.tsx
src/components/payment_gateways/CheckoutComGateway.tsx
src/components/payment_gateways/KlarnaGateway.tsx
src/components/payment_gateways/BraintreeGateway.tsx
src/components/payment_gateways/AdyenGateway.tsx
src/components/payment_gateways/PaypalGateway.tsx
src/components/payment_gateways/WireTransferGateway.tsx
src/components/payment_source/PaymentSourceBrandName.tsx
src/components/payment_source/PaypalPayment.tsx
src/components/payment_source/BraintreePayment.tsx
src/components/gift_cards/GiftCard.tsx
src/components/line_items/LineItemOption.tsx
src/components/utils/BaseOrderPrice.tsx
src/components/shipping_methods/ShippingMethod.tsx
src/components/SubmitButton.tsx
src/components/orders/PlaceOrderButton.tsx
src/components/orders/OrderListRow.tsx
src/components/addresses/SaveAddressesButton.tsx
src/components/addresses/Address.tsx
src/components/addresses/AddressStateSelector.tsx
src/components/shipments/ShipmentField.tsx
src/components/shipments/ShipmentsContainer.tsx
src/components/customers/SaveCustomerButton.tsx
🛠️ Utils
src/utils/countryStateCity.ts
src/utils/promisify.ts
src/utils/addressesManager.ts
src/utils/getErrors.ts
src/utils/shipments.ts
src/utils/validateFormFields.ts
src/utils/getAmount.ts
src/utils/getPrices.tsx
✅ Acceptance criteria
🔗 References
🎯 Summary
Remove
lodashand@types/lodashpackages from the project and replace all usages with native JavaScript/TypeScript equivalents.💡 Motivation
📂 Affected files
🗂️ Dependencies (
packages/react-components/package.json)lodash^4.17.21@types/lodash^4.17.21📄 Source files using lodash
⚙️ Reducers
src/reducers/AddressReducer.tssrc/reducers/PlaceOrderReducer.tssrc/reducers/GiftCardReducer.tssrc/reducers/OrderReducer.ts🧩 Components
src/components/payment_gateways/StripeGateway.tsxsrc/components/payment_gateways/ExternalGateway.tsxsrc/components/payment_gateways/CheckoutComGateway.tsxsrc/components/payment_gateways/KlarnaGateway.tsxsrc/components/payment_gateways/BraintreeGateway.tsxsrc/components/payment_gateways/AdyenGateway.tsxsrc/components/payment_gateways/PaypalGateway.tsxsrc/components/payment_gateways/WireTransferGateway.tsxsrc/components/payment_source/PaymentSourceBrandName.tsxsrc/components/payment_source/PaypalPayment.tsxsrc/components/payment_source/BraintreePayment.tsxsrc/components/gift_cards/GiftCard.tsxsrc/components/line_items/LineItemOption.tsxsrc/components/utils/BaseOrderPrice.tsxsrc/components/shipping_methods/ShippingMethod.tsxsrc/components/SubmitButton.tsxsrc/components/orders/PlaceOrderButton.tsxsrc/components/orders/OrderListRow.tsxsrc/components/addresses/SaveAddressesButton.tsxsrc/components/addresses/Address.tsxsrc/components/addresses/AddressStateSelector.tsxsrc/components/shipments/ShipmentField.tsxsrc/components/shipments/ShipmentsContainer.tsxsrc/components/customers/SaveCustomerButton.tsx🛠️ Utils
src/utils/countryStateCity.tssrc/utils/promisify.tssrc/utils/addressesManager.tssrc/utils/getErrors.tssrc/utils/shipments.tssrc/utils/validateFormFields.tssrc/utils/getAmount.tssrc/utils/getPrices.tsx✅ Acceptance criteria
import ... from "lodash"(orlodash/*) statements are removed.Object.assign,Array.prototypemethods, optional chaining, nullish coalescing, etc.).lodashand@types/lodashremoved frompackage.json.🔗 References