Skip to content

Commit 8d7d44d

Browse files
committed
sort renames alphabetically where applicable
1 parent 52cc99a commit 8d7d44d

1 file changed

Lines changed: 69 additions & 73 deletions

File tree

scripts/codemods/ac3-to-ac4/src/renames.ts

Lines changed: 69 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
7070
...[
7171
// were re-exported from the `@apollo/client/react` entry point
7272
{ from: "ApolloProvider" },
73-
{ from: "getApolloContext" },
7473
{ from: "createQueryPreloader" },
75-
{ from: "useQuery" },
76-
{ from: "useSuspenseQuery" },
77-
{ from: "useBackgroundQuery" },
78-
{ from: "useSuspenseFragment" },
79-
{ from: "useLoadableQuery" },
80-
{ from: "useQueryRefHandlers" },
81-
{ from: "useReadQuery" },
74+
{ from: "getApolloContext" },
8275
{ from: "skipToken" },
8376
{ from: "useApolloClient" },
77+
{ from: "useBackgroundQuery" },
78+
{ from: "useFragment" },
8479
{ from: "useLazyQuery" },
80+
{ from: "useLoadableQuery" },
8581
{ from: "useMutation" },
86-
{ from: "useSubscription" },
82+
{ from: "useQuery" },
83+
{ from: "useQueryRefHandlers" },
8784
{ from: "useReactiveVar" },
88-
{ from: "useFragment" },
85+
{ from: "useReadQuery" },
86+
{ from: "useSubscription" },
87+
{ from: "useSuspenseFragment" },
88+
{ from: "useSuspenseQuery" },
8989
].map(
9090
moveInto({
9191
from: { module: "@apollo/client" },
@@ -96,52 +96,52 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
9696
...[
9797
// were re-exported from the `@apollo/client/react` entry point
9898
{ from: "ApolloContextValue" },
99-
{ from: "PreloadQueryOptions" },
100-
{ from: "PreloadQueryFetchPolicy" },
101-
{ from: "PreloadQueryFunction" },
102-
{ from: "UseSuspenseQueryResult" },
103-
{ from: "UseBackgroundQueryResult" },
104-
{ from: "UseSuspenseFragmentResult" },
105-
{ from: "UseSuspenseFragmentOptions" },
106-
{ from: "LoadQueryFunction" },
107-
{ from: "UseLoadableQueryResult" },
108-
{ from: "UseQueryRefHandlersResult" },
109-
{ from: "UseReadQueryResult" },
110-
{ from: "SkipToken" },
111-
{ from: "UseFragmentOptions" },
112-
{ from: "UseFragmentResult" },
113-
{ from: "QueryReference" },
114-
{ from: "QueryRef" },
115-
{ from: "PreloadedQueryRef" },
116-
{ from: "Context" },
117-
{ from: "QueryFunctionOptions" },
118-
{ from: "QueryResult" },
119-
{ from: "QueryHookOptions" },
120-
{ from: "LazyQueryHookOptions" },
121-
{ from: "LazyQueryHookExecOptions" },
122-
{ from: "SuspenseQueryHookFetchPolicy" },
123-
{ from: "SuspenseQueryHookOptions" },
12499
{ from: "BackgroundQueryHookFetchPolicy" },
125100
{ from: "BackgroundQueryHookOptions" },
126-
{ from: "LoadableQueryHookFetchPolicy" },
127-
{ from: "LoadableQueryHookOptions" },
128-
{ from: "LazyQueryResult" },
129-
{ from: "QueryTuple" },
101+
{ from: "BaseSubscriptionOptions" },
102+
{ from: "Context" },
130103
{ from: "LazyQueryExecFunction" },
104+
{ from: "LazyQueryHookExecOptions" },
105+
{ from: "LazyQueryHookOptions" },
106+
{ from: "LazyQueryResult" },
131107
{ from: "LazyQueryResultTuple" },
132-
{ from: "MutationFunctionOptions" },
133-
{ from: "MutationResult" },
108+
{ from: "LoadableQueryHookFetchPolicy" },
109+
{ from: "LoadableQueryHookOptions" },
110+
{ from: "LoadQueryFunction" },
134111
{ from: "MutationFunction" },
112+
{ from: "MutationFunctionOptions" },
135113
{ from: "MutationHookOptions" },
114+
{ from: "MutationResult" },
136115
{ from: "MutationTuple" },
116+
{ from: "NoInfer" },
137117
{ from: "OnDataOptions" },
138118
{ from: "OnSubscriptionDataOptions" },
139-
{ from: "BaseSubscriptionOptions" },
140-
{ from: "SubscriptionResult" },
141-
{ from: "SubscriptionHookOptions" },
119+
{ from: "PreloadedQueryRef" },
120+
{ from: "PreloadQueryFetchPolicy" },
121+
{ from: "PreloadQueryFunction" },
122+
{ from: "PreloadQueryOptions" },
123+
{ from: "QueryFunctionOptions" },
124+
{ from: "QueryHookOptions" },
125+
{ from: "QueryRef" },
126+
{ from: "QueryReference" },
127+
{ from: "QueryResult" },
128+
{ from: "QueryTuple" },
129+
{ from: "SkipToken" },
142130
{ from: "SubscriptionDataOptions" },
131+
{ from: "SubscriptionHookOptions" },
132+
{ from: "SubscriptionResult" },
133+
{ from: "SuspenseQueryHookFetchPolicy" },
134+
{ from: "SuspenseQueryHookOptions" },
135+
{ from: "UseBackgroundQueryResult" },
136+
{ from: "UseFragmentOptions" },
137+
{ from: "UseFragmentResult" },
138+
{ from: "UseLoadableQueryResult" },
139+
{ from: "UseQueryRefHandlersResult" },
140+
{ from: "UseReadQueryResult" },
141+
{ from: "UseSuspenseFragmentOptions" },
142+
{ from: "UseSuspenseFragmentResult" },
143+
{ from: "UseSuspenseQueryResult" },
143144
{ from: "VariablesOption" },
144-
{ from: "NoInfer" },
145145
].map(
146146
moveInto({
147147
from: { module: "@apollo/client" },
@@ -151,8 +151,8 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
151151
),
152152
...[
153153
// move to the `@apollo/client/react` entry point
154-
{ from: "QueryRef" },
155154
{ from: "PreloadedQueryRef" },
155+
{ from: "QueryRef" },
156156
].map(
157157
moveInto({
158158
from: { module: "@apollo/client/react/internal" },
@@ -162,9 +162,9 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
162162
),
163163
...[
164164
// move to the `@apollo/client/utilities/internal` entry point
165+
{ from: "argumentsObjectFromField" },
165166
{ from: "AutoCleanedStrongCache" },
166167
{ from: "AutoCleanedWeakCache" },
167-
{ from: "argumentsObjectFromField" },
168168
{ from: "canUseDOM" },
169169
{ from: "checkDocument" },
170170
{ from: "cloneDeep" },
@@ -175,12 +175,16 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
175175
{ from: "dealias" },
176176
{ from: "decoratePromise" },
177177
{ from: "DeepMerger" },
178+
{ from: "filterMap" },
179+
{ from: "getApolloCacheMemoryInternals" },
180+
{ from: "getApolloClientMemoryInternals" },
178181
{ from: "getDefaultValues" },
179-
{ from: "getFragmentFromSelection" },
180-
{ from: "getFragmentQueryDocument" },
181182
{ from: "getFragmentDefinition" },
182183
{ from: "getFragmentDefinitions" },
184+
{ from: "getFragmentFromSelection" },
185+
{ from: "getFragmentQueryDocument" },
183186
{ from: "getGraphQLErrorsFromResult" },
187+
{ from: "getInMemoryCacheMemoryInternals" },
184188
{ from: "getOperationDefinition" },
185189
{ from: "getOperationName" },
186190
{ from: "getQueryDefinition" },
@@ -202,17 +206,13 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
202206
{ from: "mergeOptions" },
203207
{ from: "omitDeep" },
204208
{ from: "preventUnhandledRejection" },
209+
{ from: "registerGlobalCache" },
205210
{ from: "removeDirectivesFromDocument" },
206211
{ from: "resultKeyNameFromField" },
207212
{ from: "shouldInclude" },
208213
{ from: "storeKeyNameFromField" },
209214
{ from: "stringifyForDisplay" },
210215
{ from: "toQueryResult" },
211-
{ from: "filterMap" },
212-
{ from: "getApolloCacheMemoryInternals" },
213-
{ from: "getApolloClientMemoryInternals" },
214-
{ from: "getInMemoryCacheMemoryInternals" },
215-
{ from: "registerGlobalCache" },
216216
].map(
217217
moveInto({
218218
from: {
@@ -250,14 +250,14 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
250250
importType: "type",
251251
})
252252
),
253-
...[{ from: "VariablesOption" }, { from: "NoInfer" }].map(
253+
...[{ from: "NoInfer" }, { from: "VariablesOption" }].map(
254254
moveInto({
255255
from: { module: "@apollo/client/react" },
256256
to: { module: "@apollo/client/utilities/internal" },
257257
importType: "type",
258258
})
259259
),
260-
...[{ from: "__DEV__" }, { from: "DEV", to: "__DEV__" }].map(
260+
...[{ from: "DEV", to: "__DEV__" }, { from: "__DEV__" }].map(
261261
moveInto({
262262
from: {
263263
module: "@apollo/client/utilities/global",
@@ -267,7 +267,7 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
267267
importType: "value",
268268
})
269269
),
270-
...[{ from: "maybe" }, { from: "global" }].map(
270+
...[{ from: "global" }, { from: "maybe" }].map(
271271
moveInto({
272272
from: {
273273
module: "@apollo/client/utilities/global",
@@ -279,8 +279,8 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
279279
),
280280
...[
281281
{ from: "invariant" },
282-
{ from: "newInvariantError" },
283282
{ from: "InvariantError" },
283+
{ from: "newInvariantError" },
284284
].map(
285285
moveInto({
286286
from: { module: "@apollo/client/utilities/global" },
@@ -295,10 +295,7 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
295295
{ from: "DevtoolsOptions" },
296296
{ from: "MutateResult" },
297297
{ from: "MutationOptions", to: "MutateOptions" },
298-
{
299-
from: "QueryOptions",
300-
postProcess: reorderGenerics([1, 0]),
301-
},
298+
{ from: "QueryOptions", postProcess: reorderGenerics([1, 0]) },
302299
{ from: "RefetchQueriesOptions" },
303300
{ from: "RefetchQueriesResult" },
304301
{
@@ -317,8 +314,8 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
317314
...[
318315
// move into `ObservableQuery` type namespace
319316
{ from: "ApolloQueryResult", to: "Result" },
320-
{ from: "SubscribeToMoreOptions" },
321317
{ from: "FetchMoreOptions" },
318+
{ from: "SubscribeToMoreOptions" },
322319
].map(
323320
moveInto({
324321
from: { module: "@apollo/client" },
@@ -379,8 +376,8 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
379376
{ from: "LazyQueryHookExecOptions", to: "ExecOptions" },
380377
{ from: "LazyQueryHookOptions", to: "Options" },
381378
{ from: "LazyQueryResult", to: "Result" },
382-
{ from: "QueryTuple", to: "ResultTuple" },
383379
{ from: "LazyQueryResultTuple", to: "ResultTuple" },
380+
{ from: "QueryTuple", to: "ResultTuple" },
384381
].map(
385382
moveInto({
386383
from: {
@@ -434,10 +431,10 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
434431
})
435432
),
436433
...[
434+
{ from: "BaseSubscriptionOptions", to: "Options" },
437435
{ from: "OnDataOptions" },
438436
{ from: "OnSubscriptionDataOptions" },
439437
{ from: "SubscriptionHookOptions", to: "Options" },
440-
{ from: "BaseSubscriptionOptions", to: "Options" },
441438
{
442439
from: "SubscriptionResult",
443440
to: "Result",
@@ -568,9 +565,9 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
568565

569566
...[
570567
// move into `ApolloLink` runtime namespace
571-
{ from: "from" },
572-
{ from: "empty" },
573568
{ from: "concat" },
569+
{ from: "empty" },
570+
{ from: "from" },
574571
{ from: "split" },
575572
].map(
576573
moveInto({
@@ -586,14 +583,13 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
586583
// move into `ApolloLink` type namespace
587584
{
588585
from: "FetchResult",
589-
to: "Result",
590-
// FetchResult<TData, TContext, TExtensions> -> ApolloLink.Result<TData, TExtensions>
586+
to: "Result", // FetchResult<TData, TContext, TExtensions> -> ApolloLink.Result<TData, TExtensions>
591587
postProcess: reorderGenerics([0, 2]),
592588
},
593589
{ from: "GraphQLRequest", to: "Request" },
590+
{ from: "NextLink", to: "ForwardFunction" },
594591
{ from: "Operation" },
595592
{ from: "RequestHandler" },
596-
{ from: "NextLink", to: "ForwardFunction" },
597593
].map(
598594
moveInto({
599595
from: {
@@ -605,10 +601,10 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
605601
})
606602
),
607603
...[
608-
{ from: "ExecutionPatchInitialResult", to: "InitialResult" },
609-
{ from: "IncrementalPayload", to: "IncrementalDeferPayload" },
610604
{ from: "ExecutionPatchIncrementalResult", to: "SubsequentResult" },
605+
{ from: "ExecutionPatchInitialResult", to: "InitialResult" },
611606
{ from: "ExecutionPatchResult", to: "Chunk" },
607+
{ from: "IncrementalPayload", to: "IncrementalDeferPayload" },
612608
].map(
613609
moveInto({
614610
from: {
@@ -668,8 +664,8 @@ export const renames: Array<IdentifierRename | ModuleRename> = [
668664
})
669665
),
670666
...[
671-
{ from: "ErrorResponse", to: "ErrorHandlerOptions" },
672667
{ from: "ErrorHandler" },
668+
{ from: "ErrorResponse", to: "ErrorHandlerOptions" },
673669
].map(
674670
moveInto({
675671
from: {

0 commit comments

Comments
 (0)