Skip to content

Commit

Permalink
Merge branch 'main' into pr/edge
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas authored Apr 3, 2024
2 parents 84f7c8d + 9fc65d3 commit 133141c
Show file tree
Hide file tree
Showing 12 changed files with 371 additions and 243 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:

- name: Create comment
if: github.event_name == 'issue_comment'
uses: peter-evans/create-or-update-comment@v3.0.1
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
version: ${{ steps.version.outputs.matrix }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
Expand All @@ -42,10 +42,10 @@ jobs:
matrix:
version: ${{ fromJson(needs.matrix.outputs.version) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "20.11.0"
cache: "yarn"
- run: yarn install --immutable
- run: yarn workspaces foreach --all --include "@apollo/*" add -D -P @apollo/client@${{ matrix.version }}
Expand All @@ -61,8 +61,8 @@ jobs:
matrix:
version: ${{ fromJson(needs.matrix.outputs.version) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
Expand All @@ -82,8 +82,8 @@ jobs:
run:
working-directory: ./integration-test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
Expand All @@ -107,7 +107,7 @@ jobs:
id: playwright-version
run: yarn why @playwright/test --json | jq '.children|to_entries[0].value.locator' --raw-output | sed 's/^.*npm:/PLAYWRIGHT_VERSION=/' >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
Expand Down
6 changes: 3 additions & 3 deletions examples/app-dir-experiments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"@apollo/experimental-nextjs-app-support": "workspace:^",
"@apollo/server": "^4.9.5",
"@as-integrations/next": "^3.0.0",
"@types/node": "18.15.3",
"@types/react": "^18.2.55",
"@types/react-dom": "18.0.11",
"@types/node": "20.12.2",
"@types/react": "18.2.73",
"@types/react-dom": "18.2.23",
"client-only": "^0.0.1",
"encoding": "^0.1.13",
"eslint": "8.36.0",
Expand Down
8 changes: 4 additions & 4 deletions examples/hack-the-supergraph-ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@emotion/core": "^11.0.0",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@types/node": "18.15.11",
"@types/react": "^18.2.55",
"@types/react-dom": "18.0.11",
"@types/node": "20.12.2",
"@types/react": "18.2.73",
"@types/react-dom": "18.2.23",
"eslint": "8.38.0",
"eslint-config-next": "13.3.0",
"framer-motion": "^10.12.2",
Expand All @@ -35,6 +35,6 @@
"typescript": "5.0.4"
},
"devDependencies": {
"@types/js-cookie": "^3.0.3"
"@types/js-cookie": "3.0.6"
}
}
6 changes: 3 additions & 3 deletions examples/polls-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"@apollo/client": "^3.9.9",
"@apollo/experimental-nextjs-app-support": "workspace:^",
"@apollo/server": "^4.9.5",
"@types/node": "18.16.3",
"@types/react": "^18.2.55",
"@types/react-dom": "18.2.1",
"@types/node": "20.12.2",
"@types/react": "18.2.73",
"@types/react-dom": "18.2.23",
"@vercel/kv": "^0.1.1",
"autoprefixer": "10.4.14",
"clsx": "^1.2.1",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
},
"devDependencies": {
"@microsoft/api-documenter": "7.24.1",
"@size-limit/file": "11.1.0",
"@size-limit/webpack": "11.1.0",
"@size-limit/webpack-why": "11.1.0",
"size-limit": "11.1.0"
"@size-limit/file": "11.1.2",
"@size-limit/webpack": "11.1.2",
"@size-limit/webpack-why": "11.1.2",
"size-limit": "11.1.2"
}
}
22 changes: 12 additions & 10 deletions packages/client-react-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,40 +103,42 @@
"test:rsc": "NODE_OPTIONS=\"$NODE_OPTIONS --conditions=react-server\" yarn run test:base",
"prepack": "yarn build",
"prepublishOnly": "yarn pack -o attw.tgz && attw attw.tgz && rm attw.tgz && yarn run test",
"test-bundle": "yarn test-bundle:attw && yarn test-bundle:package && yarn test-bundle:shape",
"test-bundle": "yarn test-bundle:attw && yarn test-bundle:package && yarn test-bundle:publint && yarn test-bundle:shape",
"test-bundle:attw": "attw --pack .",
"test-bundle:package": "yarn workspace monorepo verify-package-json $PWD/package.json",
"test-bundle:publint": "publint --strict",
"test-bundle:shape": "yarn workspace monorepo verify-package-shape $PWD/package-shape.json",
"bundle-info": "yarn test-bundle --format json | jq '.analysis.entrypoints|to_entries|map({key:.key,value:.value.resolutions|to_entries|map({key:.key,value:.value.resolution.fileName })|from_entries})|from_entries'",
"lint": "eslint --ext .ts,.tsx src"
},
"devDependencies": {
"@apollo/client": "3.9.9",
"@arethetypeswrong/cli": "0.15.2",
"@microsoft/api-extractor": "7.42.3",
"@testing-library/react": "14.2.1",
"@microsoft/api-extractor": "7.43.0",
"@testing-library/react": "14.2.2",
"@total-typescript/shoehorn": "0.1.2",
"@tsconfig/recommended": "1.0.3",
"@types/node": "20.11.30",
"@types/react": "18.2.67",
"@typescript-eslint/eslint-plugin": "7.0.1",
"@typescript-eslint/parser": "7.0.1",
"@tsconfig/recommended": "1.0.5",
"@types/node": "20.12.2",
"@types/react": "18.2.73",
"@typescript-eslint/eslint-plugin": "7.5.0",
"@typescript-eslint/parser": "7.5.0",
"concurrently": "8.2.2",
"eslint": "8.57.0",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react-hooks": "4.6.0",
"glob": "10.3.10",
"glob": "10.3.12",
"global-jsdom": "24.0.0",
"globstar": "1.0.0",
"graphql": "16.8.1",
"jsdom": "24.0.0",
"publint": "0.2.7",
"react": "18.3.0-canary-60a927d04-20240113",
"react-error-boundary": "4.0.13",
"rimraf": "5.0.5",
"superjson": "1.13.3",
"ts-node": "10.9.2",
"tsup": "8.0.2",
"tsx": "4.7.0",
"tsx": "4.7.1",
"typescript": "5.4.3",
"vitest": "1.4.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ import { test, mock } from "node:test";
import assert from "node:assert";
import { fromPartial } from "@total-typescript/shoehorn";
import type { SubscriptionObserver } from "zen-observable-ts";
import { runInConditions } from "./util/runInConditions.js";

runInConditions("node", "browser");

const { DebounceMultipartResponsesLink: AccumulateMultipartResponsesLink } =
await import("#bundled");

test("normal queries can resolve synchronously", () => {
await test("normal queries can resolve synchronously", () => {
const query = gql`
query {
fastField
Expand Down Expand Up @@ -49,7 +46,7 @@ test("normal queries can resolve synchronously", () => {
});
});

test("deferred query will complete synchonously if maxDelay is 0", () => {
await test("deferred query will complete synchonously if maxDelay is 0", () => {
const query = gql`
query {
fastField
Expand Down Expand Up @@ -84,7 +81,7 @@ test("deferred query will complete synchonously if maxDelay is 0", () => {
});
});

test("`next` call will be debounced and results will be merged together", () => {
await test("`next` call will be debounced and results will be merged together", () => {
mock.timers.enable();

const query = gql`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { gql, Observable } from "@apollo/client/core/index.js";
import { print } from "graphql";
import { it } from "node:test";
import assert from "node:assert";
import { runInConditions } from "./util/runInConditions.js";

runInConditions("node", "browser");

const { RemoveMultipartDirectivesLink } = await import("#bundled");

Expand Down Expand Up @@ -51,7 +48,7 @@ const queryWithDeferAndStripAnnotation = gql`
}
`;

it("removes fields with a @defer directive", () => {
await it("removes fields with a @defer directive", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: true,
});
Expand All @@ -69,7 +66,7 @@ query myQuery {
);
});

it("`stripDefer` defaults to `true`", () => {
await it("`stripDefer` defaults to `true`", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: true,
});
Expand All @@ -87,7 +84,7 @@ query myQuery {
);
});

it("preserves @defer fields with a `SsrDontStrip` label", () => {
await it("preserves @defer fields with a `SsrDontStrip` label", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: true,
});
Expand All @@ -114,7 +111,7 @@ query myQuery {
);
});

it("can be configured to not remove @defer fields", () => {
await it("can be configured to not remove @defer fields", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: false,
});
Expand All @@ -138,7 +135,7 @@ query myQuery {
);
});

it("even with `stripDefer: false`, certain fields can be marked for stripping", () => {
await it("even with `stripDefer: false`, certain fields can be marked for stripping", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: false,
});
Expand Down
22 changes: 12 additions & 10 deletions packages/experimental-nextjs-app-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@
"test": "true",
"prepack": "yarn build",
"prepublishOnly": "yarn pack -o attw.tgz && attw attw.tgz && rm attw.tgz && yarn run test",
"test-bundle": "yarn test-bundle:attw && yarn test-bundle:package && yarn test-bundle:shape",
"test-bundle": "yarn test-bundle:attw && yarn test-bundle:package && yarn test-bundle:publint && yarn test-bundle:shape",
"test-bundle:attw": "attw --pack .",
"test-bundle:package": "yarn workspace monorepo verify-package-json $PWD/package.json",
"test-bundle:publint": "publint --strict",
"test-bundle:shape": "yarn workspace monorepo verify-package-shape $PWD/package-shape.json",
"bundle-info": "yarn test-bundle --format json | jq '.analysis.entrypoints|to_entries|map({key:.key,value:.value.resolutions|to_entries|map({key:.key,value:.value.resolution.fileName })|from_entries})|from_entries'",
"lint": "eslint --ext .ts,.tsx ."
Expand All @@ -81,29 +82,30 @@
"@apollo/client": "3.9.9",
"@apollo/client-react-streaming": "workspace:*",
"@arethetypeswrong/cli": "0.15.2",
"@microsoft/api-extractor": "7.42.3",
"@testing-library/react": "14.2.1",
"@microsoft/api-extractor": "7.43.0",
"@testing-library/react": "14.2.2",
"@total-typescript/shoehorn": "0.1.2",
"@tsconfig/recommended": "1.0.3",
"@types/node": "20.11.30",
"@types/react": "18.2.67",
"@typescript-eslint/eslint-plugin": "7.0.1",
"@typescript-eslint/parser": "7.0.1",
"@tsconfig/recommended": "1.0.5",
"@types/node": "20.12.2",
"@types/react": "18.2.73",
"@typescript-eslint/eslint-plugin": "7.5.0",
"@typescript-eslint/parser": "7.5.0",
"concurrently": "8.2.2",
"eslint": "8.57.0",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react-hooks": "4.6.0",
"glob": "10.3.10",
"glob": "10.3.12",
"global-jsdom": "24.0.0",
"globstar": "1.0.0",
"graphql": "16.8.1",
"jsdom": "24.0.0",
"next": "14.1.0",
"publint": "0.2.7",
"react": "18.3.0-canary-60a927d04-20240113",
"rimraf": "5.0.5",
"ts-node": "10.9.2",
"tsup": "8.0.2",
"tsx": "4.7.0",
"tsx": "4.7.1",
"typescript": "5.4.3",
"vitest": "1.4.0"
},
Expand Down
6 changes: 4 additions & 2 deletions scripts/verify-package-json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ if (notfound > 0) {

async function checkPackage(/** @type {string} */ pkg) {
const json = JSON.parse(await readFile(pkg, { encoding: "utf-8" }));
await ensureLeafFilesExist(dirname(pkg), json.exports);
// handled by publint
// await ensureLeafFilesExist(dirname(pkg), json.exports);
await ensureLeafFilesExist(dirname(pkg), json.typesVersions);
await ensureLeafFilesExist(dirname(pkg), json.types);
await ensureLeafFilesExist(dirname(pkg), json.typings);
await ensureLeafFilesExist(dirname(pkg), json.main);
// handled by publint
// await ensureLeafFilesExist(dirname(pkg), json.main);
}

/**
Expand Down
Loading

0 comments on commit 133141c

Please sign in to comment.