Skip to content

Commit 56e2502

Browse files
committed
rename to zz_removals, clean up
1 parent 4701410 commit 56e2502

File tree

9 files changed

+1192
-763
lines changed

9 files changed

+1192
-763
lines changed

.api-reports/api-report-zz_removals.api.md

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"./react/internal": "./src/react/internal/index.ts",
6060
"./react/internal/compiler-runtime": "./src/react/internal/compiler-runtime/index.ts",
6161
"./react/ssr": "./src/react/ssr/index.ts",
62-
"./removals": "./src/removals.ts",
6362
"./testing": "./src/testing/index.ts",
6463
"./testing/react": "./src/testing/react/index.ts",
6564
"./utilities": "./src/utilities/index.ts",
@@ -77,7 +76,8 @@
7776
"production": "./src/utilities/environment/index.production.ts",
7877
"development": "./src/utilities/environment/index.development.ts",
7978
"default": "./src/utilities/environment/index.ts"
80-
}
79+
},
80+
"./zz_removals": "./src/zz_removals.ts"
8181
},
8282
"scripts": {
8383
"prebuild": "npm run clean",

scripts/codemods/ac3-to-ac4/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npx @apollo/client-codemod-migrate-3-to-4 --parser ts file1.ts file2.ts --codem
1717
- `imports`: Moves imports that have been moved or renamed in Apollo Client 4. Also moves types into namespace imports where applicable.
1818
- `links`: Moves `split`, `from`, `concat` and `empty` onto the `ApolloLink` namespace, changes funtion link invocations like `createHttpLink(...)` to their class equivalents like (`new HttpLink(...)`).
1919
Does not change `setContext((operation, prevContext) => {})` to `new ContextLink((prevContext, operation) => {})` - this requires manual intervention, as the order of callback arguments is flipped and this is not reliable codemoddable.
20-
- `removals`: Points all imports of values or types that have been removed in Apollo Client 4 to the `@apollo/client/removals` namespace. That export contains context for each removal, oftentimes with migration instructions.
20+
- `removals`: Points all imports of values or types that have been removed in Apollo Client 4 to the `@apollo/client/zz_removals` entry point. That entry point contains context for each removal, oftentimes with migration instructions.
2121

2222
### Usage against TypeScript/TSX
2323

scripts/codemods/ac3-to-ac4/src/__tests__/__snapshots__/removals.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ exports[`all exports 1`] = `
231231
+ removeConnectionDirectiveFromDocument as utilities_removeConnectionDirectiveFromDocument,
232232
+ removeFragmentSpreadFromDocument as utilities_removeFragmentSpreadFromDocument,
233233
+ valueToObjectRepresentation as utilities_valueToObjectRepresentation,
234-
+} from "@apollo/client/removals";
234+
+} from "@apollo/client/zz_removals";
235235
+
236236
+import type {
237237
+ ClientParseError as _ClientParseError,
@@ -311,7 +311,7 @@ exports[`all exports 1`] = `
311311
+ TupleToIntersection as utilities_TupleToIntersection,
312312
+ UnionToIntersection as utilities_UnionToIntersection,
313313
+ VariableValue as utilities_VariableValue,
314-
+} from "@apollo/client/removals";
314+
+} from "@apollo/client/zz_removals";
315315
+
316316
+import {
317317
ApolloClientOptions as core_ApolloClientOptions,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const removalsTransform: Transform = function transform(file, api) {
179179
identifier: removal.identifier,
180180
alternativeModules: ["@apollo/client", "@apollo/client/core"],
181181
},
182-
to: { module: "@apollo/client/removals", alternativeModules: [] },
182+
to: { module: "@apollo/client/zz_removals", alternativeModules: [] },
183183
importType: removal.importType,
184184
};
185185
handleIdentiferRename({

src/__tests__/__snapshots__/exports.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,5 @@ Array [
487487
"setVerbosity",
488488
]
489489
`;
490+
491+
exports[`exports of public entry points @apollo/client/zz_removals 1`] = `Array []`;

src/__tests__/exports.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import * as utilitiesEnvironment from "@apollo/client/utilities/environment";
4343
import * as utilitiesInternal from "@apollo/client/utilities/internal";
4444
import * as utilitiesInternalGlobals from "@apollo/client/utilities/internal/globals";
4545
import * as utilitiesInvariant from "@apollo/client/utilities/invariant";
46+
import * as zz_removals from "@apollo/client/zz_removals";
4647

4748
// eslint-disable-next-line local-rules/no-relative-imports
4849
import { entryPoints } from "../../config/entryPoints.js";
@@ -105,6 +106,7 @@ describe("exports of public entry points", () => {
105106
check("@apollo/client/utilities/internal/globals", utilitiesInternalGlobals);
106107
check("@apollo/client/utilities/invariant", utilitiesInvariant);
107108
check("@apollo/client/utilities/environment", utilitiesEnvironment);
109+
check("@apollo/client/zz_removals", zz_removals);
108110

109111
checkWithConditions("@apollo/client/react", ["react-server"]);
110112

0 commit comments

Comments
 (0)