fix(medusa): Optimize Cart totals calculation (#2372)
**What** The existing totals calculations are extremely heavy and perform an enormous amount of duplicate work. The changes here remove large parts of the overhead and improves response times for cart endpoints up to 30x.
This commit is contained in:
1 parent
527c587d8f
commit
3d255302b0
45 files changed
+10970
-8082
No files matched your search
@@ -0,0 +1,4 @@
|
||||
npmRegistryServer: "http://localhost:4873"
|
||||
|
||||
unsafeHttpWhitelist:
|
||||
- localhost
|
||||
@@ -328,7 +328,6 @@ Object {
|
||||
"title": "Intelligent Plastic Chips",
|
||||
"totals": Object {
|
||||
"discount_total": 0,
|
||||
"gift_card_total": 0,
|
||||
"original_tax_total": 200,
|
||||
"original_total": 1200,
|
||||
"quantity": 1,
|
||||
@@ -1022,7 +1021,6 @@ Object {
|
||||
"title": "Intelligent Plastic Chips",
|
||||
"totals": Object {
|
||||
"discount_total": 0,
|
||||
"gift_card_total": 0,
|
||||
"original_tax_total": 400,
|
||||
"original_total": 2400,
|
||||
"quantity": 2,
|
||||
@@ -1477,7 +1475,6 @@ Object {
|
||||
"title": "Intelligent Plastic Chips",
|
||||
"totals": Object {
|
||||
"discount_total": 0,
|
||||
"gift_card_total": 0,
|
||||
"original_tax_total": 200,
|
||||
"original_total": 1200,
|
||||
"quantity": 1,
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
"build": "babel src -d dist --extensions \".ts,.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@medusajs/medusa": "1.2.1-dev-1649009241281",
|
||||
"@medusajs/medusa": "1.4.1-dev-1665082901122",
|
||||
"faker": "^5.5.3",
|
||||
"medusa-fulfillment-webshipper": "1.2.1-dev-1649009241281",
|
||||
"medusa-interfaces": "1.2.1-dev-1649009241281",
|
||||
"medusa-plugin-sendgrid": "1.2.1-dev-1649009241281",
|
||||
"medusa-fulfillment-webshipper": "1.3.3-dev-1665082901122",
|
||||
"medusa-interfaces": "1.3.3-dev-1665082901122",
|
||||
"medusa-plugin-sendgrid": "1.3.3-dev-1665082901122",
|
||||
"typeorm": "^0.2.31"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.12.10",
|
||||
"@babel/core": "^7.12.10",
|
||||
"@babel/node": "^7.12.10",
|
||||
"babel-preset-medusa-package": "1.1.19-dev-1649009241281",
|
||||
"babel-preset-medusa-package": "1.1.19-dev-1665082901122",
|
||||
"jest": "^26.6.3"
|
||||
}
|
||||
}
|
||||
+10648
-7781
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user