Skip to content

Commit 91225d6

Browse files
committed
fix: use bundlewatch
1 parent da539c1 commit 91225d6

File tree

4 files changed

+352
-611
lines changed

4 files changed

+352
-611
lines changed

clients/algoliasearch-client-javascript/bundlesize.config.json

Lines changed: 0 additions & 52 deletions
This file was deleted.

clients/algoliasearch-client-javascript/package.json

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,69 @@
1010
"clean": "lerna run clean",
1111
"release:publish": "tsc --project scripts/tsconfig.json && node scripts/dist/publish.js",
1212
"test": "lerna run test $*",
13-
"test:size": "bundlesize",
13+
"test:size": "bundlewatch",
1414
"test:bundle": "lerna run test:bundle --verbose --include-dependencies"
1515
},
1616
"devDependencies": {
1717
"@types/node": "22.9.0",
18-
"bundlesize": "0.18.2",
18+
"bundlewatch": "0.4.0",
1919
"execa": "9.5.1",
2020
"lerna": "8.1.9",
2121
"rollup": "4.27.2",
2222
"typescript": "5.6.3"
2323
},
24+
"bundlewatch": {
25+
"files": [
26+
{
27+
"path": "packages/algoliasearch/dist/algoliasearch.umd.js",
28+
"maxSize": "18.15KB"
29+
},
30+
{
31+
"path": "packages/algoliasearch/dist/lite/builds/browser.umd.js",
32+
"maxSize": "3.95KB"
33+
},
34+
{
35+
"path": "packages/client-abtesting/dist/builds/browser.umd.js",
36+
"maxSize": "4.20KB"
37+
},
38+
{
39+
"path": "packages/client-analytics/dist/builds/browser.umd.js",
40+
"maxSize": "4.85KB"
41+
},
42+
{
43+
"path": "packages/client-composition/dist/builds/browser.umd.js",
44+
"maxSize": "4.55KB"
45+
},
46+
{
47+
"path": "packages/client-insights/dist/builds/browser.umd.js",
48+
"maxSize": "3.90KB"
49+
},
50+
{
51+
"path": "packages/client-personalization/dist/builds/browser.umd.js",
52+
"maxSize": "4.05KB"
53+
},
54+
{
55+
"path": "packages/client-query-suggestions/dist/builds/browser.umd.js",
56+
"maxSize": "4.05KB"
57+
},
58+
{
59+
"path": "packages/client-search/dist/builds/browser.umd.js",
60+
"maxSize": "7.25KB"
61+
},
62+
{
63+
"path": "packages/ingestion/dist/builds/browser.umd.js",
64+
"maxSize": "5.90KB"
65+
},
66+
{
67+
"path": "packages/monitoring/dist/builds/browser.umd.js",
68+
"maxSize": "3.95KB"
69+
},
70+
{
71+
"path": "packages/recommend/dist/builds/browser.umd.js",
72+
"maxSize": "4.15KB"
73+
}
74+
]
75+
},
2476
"engines": {
2577
"node": ">= 14.0.0",
2678
"yarn": "^4.0.0"

clients/algoliasearch-client-javascript/packages/client-common/src/transporter/helpers.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -82,29 +82,6 @@ export function deserializeSuccess<TObject>(response: Response): TObject {
8282
}
8383
}
8484

85-
const httpMessages: Record<number, string> = {
86-
400: 'Bad Request',
87-
401: 'Unauthorized',
88-
402: 'Payment Required',
89-
403: 'Forbidden',
90-
404: 'Not Found',
91-
405: 'Method Not Allowed',
92-
406: 'Not Acceptable',
93-
407: 'Proxy Authentication Required',
94-
408: 'Request Timeout',
95-
409: 'Conflict',
96-
410: 'Gone',
97-
411: 'Length Required',
98-
412: 'Precondition Required',
99-
413: 'Request Entry Too Large',
100-
414: 'Request-URI Too Long',
101-
415: 'Unsupported Media Type',
102-
416: 'Requested Range Not Satisfiable',
103-
417: 'Expectation Failed',
104-
418: "I'm a teapot",
105-
429: 'Too Many Requests',
106-
};
107-
10885
export function deserializeFailure({ content, status }: Response, stackFrame: StackFrame[]): Error {
10986
try {
11087
const parsed = JSON.parse(content);
@@ -115,5 +92,5 @@ export function deserializeFailure({ content, status }: Response, stackFrame: St
11592
} catch {
11693
// ..
11794
}
118-
return new ApiError(status in httpMessages ? httpMessages[status] : content, status, stackFrame);
95+
return new ApiError(content, status, stackFrame);
11996
}

0 commit comments

Comments
 (0)