Files
medusa-store/package.json
Adrien de Peretti 42d9c7222b feat(medusa): Performance improvements of Carts domain (#2648)
**What**

I have created a new method on the cart service which is `addLineItems`, allowing a user to add one or multiple items in an optimized way. Also updated the `generate` method from the line item service which now also accept a object data or a collection of data which. Various places have been optimized and cache support has been added to the price selection strategy.

The overall optimization allows to reach another 9000% improvement in the response time as a median (Creating a cart with 6 items):

|   | Min (ms)  | Median (ms)  | Max (ms)  | Median Improvement (%)
|---|:-:|---|---|---|
| Before optimisation  | 1200  | 9999 | 12698  |  N/A
| After optimisation | 63  | 252  | 500  | 39x
| After re optimisation | 56 | 82  | 399  | 121x
| After including addressed feedback | 65 | 202  | 495  | 49x

FIXES CORE-722
2022-12-07 14:39:12 +00:00

93 lines
3.7 KiB
JSON

{
"name": "root",
"private": true,
"workspaces": {
"packages": [
"packages/*"
]
},
"devDependencies": {
"@babel/core": "^7.12.7",
"@babel/eslint-parser": "^7.15.8",
"@babel/node": "^7.12.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-transform-classes": "^7.10.4",
"@babel/plugin-transform-instanceof": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.11.5",
"@babel/preset-env": "^7.11.5",
"@babel/register": "^7.11.5",
"@babel/runtime": "^7.11.2",
"@redocly/cli": "latest",
"@typescript-eslint/eslint-plugin": "^5.36.2",
"@typescript-eslint/parser": "^5.36.2",
"axios": "^0.21.1",
"axios-mock-adapter": "^1.19.0",
"babel-jest": "^26.6.3",
"babel-preset-medusa-package": "^1.0.0",
"cross-env": "^7.0.2",
"eslint": "^8.23.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"express": "^4.17.1",
"get-port": "^5.1.1",
"husky": "^7.0.2",
"import-from": "^3.0.0",
"jest": "^26.6.3",
"lint-staged": "^11.2.3",
"microbundle": "^0.13.3",
"pg-god": "^1.0.11",
"prettier": "^2.7.1",
"resolve-cwd": "^3.0.0",
"ts-jest": "^26.5.6",
"ts-node": "^10.9.1",
"turbo": "^1.3.1",
"typedoc": "0.23.10",
"typedoc-frontmatter-plugin": "link:docs-util/typedoc-plugins/typedoc-frontmatter-plugin",
"typedoc-monorepo-link-types": "^0.0.2",
"typedoc-plugin-markdown": "^3.13.4",
"typedoc-plugin-merge-modules": "^4.0.1",
"typedoc-plugin-reference-excluder": "^1.0.0",
"typeorm": "^0.2.31"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "yarn run lint",
"*.{md,yaml,yml}": "prettier --write"
},
"scripts": {
"hooks:install": "husky install",
"hooks:uninstall": "husky uninstall",
"build": "turbo run build",
"lint": "eslint --ignore-path .eslintignore --ext .js,.ts,.tsx .",
"prettier": "prettier",
"jest": "jest",
"test": "turbo run test",
"test:integration": "NODE_ENV=test jest --runInBand --bail --config=integration-tests/jest.config.js",
"test:integration:api": "NODE_ENV=test jest --detectOpenHandles --forceExit --runInBand --bail --config=integration-tests/jest.config.js --projects=integration-tests/api -- integration-tests/api/__tests__/store/cart/cart.js",
"test:integration:plugins": "NODE_ENV=test jest --runInBand --bail --config=integration-tests/jest.config.js --projects=integration-tests/plugins",
"test:fixtures": "NODE_ENV=test jest --config=docs-util/jest.config.js --runInBand --bail",
"openapi:generate": "node ./scripts/build-openapi.js",
"generate:services": "typedoc --options typedoc.services.js",
"generate:js-client": "typedoc --options typedoc.js-client.js",
"generate:entities": "typedoc --options typedoc.entities.js",
"release:snapshot": "changeset publish --no-git-tags --snapshot --tag snapshot",
"generate:announcement": "node ./scripts/doc-change-release.js",
"develop": "NODE_ENV=development ts-node --transpile-only ./integration-tests/development/server.js",
"develop:create:db": "NODE_ENV=development ts-node --transpile-only ./integration-tests/development/create-database.js",
"release:staging": "changeset publish --no-git-tags --snapshot --tag staging",
"version:staging": "changeset version --snapshot staging",
"check:freshness": "node ./scripts/freshness-check.js"
},
"dependencies": {
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.25.2",
"@linear/sdk": "^1.22.0",
"@octokit/core": "^4.0.5",
"global": "^4.4.0",
"import-from": "^3.0.0",
"oas-normalize": "^5.0.1",
"swagger-inline": "^3.2.2"
},
"packageManager": "yarn@3.2.1"
}