Skip to content

Commit f3b5d29

Browse files
authored
rename size-limit names on main (#12426)
1 parent 0d4b09e commit f3b5d29

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.size-limit.cjs

+29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
const limits = require("./.size-limits.json");
22

3+
/* prettier-ignore */
4+
const nameMapping = {
5+
'import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs"': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (CJS)',
6+
'import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production)': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) (CJS)',
7+
'import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js"': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client"',
8+
'import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production)': 'import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production)',
9+
'import { ApolloProvider } from "dist/react/index.js"': 'import { ApolloProvider } from "@apollo/client/react"',
10+
'import { ApolloProvider } from "dist/react/index.js" (production)': 'import { ApolloProvider } from "@apollo/client/react" (production)',
11+
'import { useQuery } from "dist/react/index.js"': 'import { useQuery } from "@apollo/client/react"',
12+
'import { useQuery } from "dist/react/index.js" (production)': 'import { useQuery } from "@apollo/client/react" (production)',
13+
'import { useLazyQuery } from "dist/react/index.js"': 'import { useLazyQuery } from "@apollo/client/react"',
14+
'import { useLazyQuery } from "dist/react/index.js" (production)': 'import { useLazyQuery } from "@apollo/client/react"',
15+
'import { useMutation } from "dist/react/index.js"': 'import { useMutation } from "@apollo/client/react"',
16+
'import { useMutation } from "dist/react/index.js" (production)': 'import { useMutation } from "@apollo/client/react" (production)',
17+
'import { useSubscription } from "dist/react/index.js"': 'import { useSubscription } from "@apollo/client/react"',
18+
'import { useSubscription } from "dist/react/index.js" (production)': 'import { useSubscription } from "@apollo/client/react" (production)',
19+
'import { useSuspenseQuery } from "dist/react/index.js"': 'import { useSuspenseQuery } from "@apollo/client/react"',
20+
'import { useSuspenseQuery } from "dist/react/index.js" (production)': 'import { useSuspenseQuery } from "@apollo/client/react" (production)',
21+
'import { useBackgroundQuery } from "dist/react/index.js"': 'import { useBackgroundQuery } from "@apollo/client/react"',
22+
'import { useBackgroundQuery } from "dist/react/index.js" (production)': 'import { useBackgroundQuery } from "@apollo/client/react" (production)',
23+
'import { useLoadableQuery } from "dist/react/index.js"': 'import { useLoadableQuery } from "@apollo/client/react"',
24+
'import { useLoadableQuery } from "dist/react/index.js" (production)': 'import { useLoadableQuery } from "@apollo/client/react" (production)',
25+
'import { useReadQuery } from "dist/react/index.js"': 'import { useReadQuery } from "@apollo/client/react"',
26+
'import { useReadQuery } from "dist/react/index.js" (production)': 'import { useReadQuery } from "@apollo/client/react" (production)',
27+
'import { useFragment } from "dist/react/index.js"': 'import { useFragment } from "@apollo/client/react"',
28+
'import { useFragment } from "dist/react/index.js" (production)': 'import { useFragment } from "@apollo/client/react" (production)',
29+
};
30+
331
const checks = [
432
{
533
path: "dist/apollo-client.min.cjs",
@@ -73,6 +101,7 @@ const checks = [
73101
]
74102
)
75103
.map((value) => {
104+
value.name = nameMapping[value.name] || value.name;
76105
value.limit = limits[value.name];
77106
return value;
78107
});

.size-limits.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"dist/apollo-client.min.cjs": 42260,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 34450
2+
"dist/apollo-client.min.cjs": 42244,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 34450
44
}

0 commit comments

Comments
 (0)