diff --git a/CHANGELOG.md b/CHANGELOG.md index 35e12c59e3..1fc3bc70c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Draft +- PDP: Reduce lodash usage by utilizing object spread operator to set main image [#1827](https://github.com/bigcommerce/cornerstone/pull/1827) - Fixed Product Image Carousel Becomes Responsiveness on Product Page. [#1879](https://github.com/bigcommerce/cornerstone/pull/1879) - Move phrases and static strings to en.json for improving translation customizing. [#1850](https://github.com/bigcommerce/cornerstone/pull/1850) - Update carousel images to improve LCP indicator from Lighthouse performance report. [#1876](https://github.com/bigcommerce/cornerstone/pull/1876) diff --git a/assets/js/theme/global/compare-products.js b/assets/js/theme/global/compare-products.js index 5911a5b6c1..6398c97486 100644 --- a/assets/js/theme/global/compare-products.js +++ b/assets/js/theme/global/compare-products.js @@ -1,4 +1,3 @@ -import _ from 'lodash'; import { showAlertModal } from './modal'; function decrementCounter(counter, item) { @@ -33,7 +32,7 @@ export default function (urlContext) { $('body').on('compareReset', () => { const $checked = $('body').find('input[name="products\[\]"]:checked'); - compareCounter = $checked.length ? _.map($checked, element => element.value) : []; + compareCounter = $checked.length ? $checked.map((index, element) => element.value).get() : []; updateCounterNav(compareCounter, $compareLink, urlContext); }); diff --git a/assets/js/theme/product/image-gallery.js b/assets/js/theme/product/image-gallery.js index 959a8b2efe..3032b57095 100644 --- a/assets/js/theme/product/image-gallery.js +++ b/assets/js/theme/product/image-gallery.js @@ -1,5 +1,4 @@ import 'easyzoom'; -import _ from 'lodash'; export default class ImageGallery { constructor($gallery) { @@ -15,7 +14,7 @@ export default class ImageGallery { } setMainImage(imgObj) { - this.currentImage = _.clone(imgObj); + this.currentImage = { ...imgObj }; this.setActiveThumb(); this.swapMainImage();