-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(commerce): replace barrel import with proper import (#3729)
As part of CAPI-496, we compared bundle sizes for different changes we wanted to make to headless and spotted issues with imports in the commerce package. Running dependency cruiser to map a graph of dependencies in the `packages/headless` folder showed that `index.ts` was being included ([full dependencies.svg file here](https://github.com/coveo/test-headless-tree-shaking/blob/main/bundler-comparison/dependencies.svg)): ```shell npx depcruise --no-config \ --exclude "^node_modules" \ --output-type dot \ src/commerce.index.ts > dependencies.out && dot dependencies.out -T svg -o dependencies.svg ``` ![image](https://github.com/coveo/ui-kit/assets/8978908/fa02b1e4-3367-4dc5-a509-f956e910200b) We then found the source of the issue was `product-listing-recent-results` with: ```shell npx depcruise --no-config \ --exclude "^node_modules" \ --output-type dot \ --ts-config tsconfig.json \ --do-not-follow "^src/index.ts" \ --focus "^src/index.ts" \ src/commerce.index.ts > dependencies.out && dot dependencies.out -T svg -o dependencies.svg ``` ![image](https://github.com/coveo/ui-kit/assets/8978908/5104100d-bd52-4329-a213-46cb2070b705) This PR replace the `index.ts` barrel import with the proper redux import.
- Loading branch information
1 parent
55fc157
commit 8f4d68d
Showing
7 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
6 changes: 4 additions & 2 deletions
6
packages/headless/src/features/commerce/product-listing/product-listing-actions.ts
This file contains 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
6 changes: 4 additions & 2 deletions
6
packages/headless/src/features/commerce/query-suggest/query-suggest-actions.ts
This file contains 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
6 changes: 4 additions & 2 deletions
6
packages/headless/src/features/commerce/search/search-actions.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/headless/src/features/product-listing/product-listing-actions.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/headless/src/features/product-listing/product-listing-recent-results.ts
This file contains 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