Skip to content

Commit

Permalink
Merge branch 'main' into pr/0.8-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Mar 15, 2024
2 parents e67a320 + 26bdfd5 commit 270645d
Show file tree
Hide file tree
Showing 5 changed files with 1,121 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/relative-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: RelativeCI

on:
workflow_run:
workflows: ["Run tests"]
workflows: ["Integration Tests (latest)"]
types:
- completed

Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Run `size-limit`"
on:
pull_request:
branches:
- main
permissions:
pull-requests: write
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
- run: yarn install --immutable
- uses: andresz1/size-limit-action@v1
with:
build_script: build:libs
github_token: ${{ secrets.GITHUB_TOKEN }}
101 changes: 101 additions & 0 deletions .size-limit.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/** @type {import('size-limit').SizeLimitConfig} */
const checks = [
{
name: "{ ApolloNextAppProvider, NextSSRApolloClient, NextSSRInMemoryCache } from '@apollo/experimental-nextjs-app-support/ssr' (Browser ESM)",
path: "packages/experimental-nextjs-app-support/dist/ssr/index.browser.js",
import:
"{ ApolloNextAppProvider, NextSSRApolloClient, NextSSRInMemoryCache }",
},
{
name: "{ WrapApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client-react-streaming' (Browser ESM)",
path: "packages/client-react-streaming/dist/index.browser.js",
import: "{ WrapApolloProvider, ApolloClient, InMemoryCache }",
},
{
name: "{ buildManualDataTransport } from '@apollo/client-react-streaming/manual-transport' (Browser ESM)",
path: "packages/client-react-streaming/dist/manual-transport.browser.cjs",
import: "{ buildManualDataTransport }",
},
{
name: "@apollo/client-react-streaming (Browser ESM)",
path: "packages/client-react-streaming/dist/index.browser.js",
},
{
name: "@apollo/client-react-streaming (SSR ESM)",
path: "packages/client-react-streaming/dist/index.ssr.js",
},
{
name: "@apollo/client-react-streaming (RSC ESM)",
path: "packages/client-react-streaming/dist/index.rsc.js",
},
{
name: "@apollo/client-react-streaming/manual-transport (Browser ESM)",
path: "packages/client-react-streaming/dist/manual-transport.browser.cjs",
},
{
name: "@apollo/client-react-streaming/manual-transport (SSR ESM)",
path: "packages/client-react-streaming/dist/manual-transport.ssr.cjs",
},
{
name: "@apollo/experimental-nextjs-app-support/ssr (Browser ESM)",
path: "packages/experimental-nextjs-app-support/dist/ssr/index.browser.js",
},
{
name: "@apollo/experimental-nextjs-app-support/ssr (SSR ESM)",
path: "packages/experimental-nextjs-app-support/dist/ssr/index.ssr.js",
},
{
name: "@apollo/experimental-nextjs-app-support/ssr (RSC ESM)",
path: "packages/experimental-nextjs-app-support/dist/ssr/index.rsc.js",
},
{
name: "@apollo/experimental-nextjs-app-support/rsc (RSC ESM)",
path: "packages/experimental-nextjs-app-support/dist/rsc/index.js",
},
];

module.exports = checks.map(
(check) =>
/** @type {import('size-limit').SizeLimitConfig} */ ({
...check,
import: check.import || "*",
modifyWebpackConfig(config) {
config.resolve = {
...config.resolve,
modules: ["node_modules"],
conditionNames: [
"import",
check.name.includes("Browser")
? "browser"
: check.name.includes("RSC")
? "react-server"
: check.name.includes("SSR")
? "node"
: "default",
],
};
return config;
},
ignore: [
...(check.ignore || []),
"rehackt",
"react",
"react-dom",
"@apollo/client",
"@graphql-typed-document-node/core",
"@wry/caches",
"@wry/context",
"@wry/equality",
"@wry/trie",
"graphql-tag",
"hoist-non-react-statics",
"optimism",
"prop-types",
"response-iterator",
"symbol-observable",
"ts-invariant",
"tslib",
"zen-observable-ts",
],
})
);
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@
"verify-package-json": "node ./scripts/verify-package-json.mjs",
"verify-package-shape": "node ./scripts/verify-package-shape.mjs",
"matrix": "node ./scripts/test-matrix.js",
"docs": "api-documenter markdown --input-folder temp --output-folder docs"
"docs": "api-documenter markdown --input-folder temp --output-folder docs",
"build:libs": "yarn workspaces foreach --all --include \"@apollo/*\" run build"
},
"resolutions": {
"[email protected]": "18.3.0-canary-60a927d04-20240113",
"[email protected]": "18.3.0-canary-60a927d04-20240113",
"superjson": "1.13.3"
},
"devDependencies": {
"@microsoft/api-documenter": "patch:@microsoft/api-documenter@npm%3A7.23.37#~/.yarn/patches/@microsoft-api-documenter-npm-7.23.37-51bf9d9d16.patch"
"@microsoft/api-documenter": "patch:@microsoft/api-documenter@npm%3A7.23.37#~/.yarn/patches/@microsoft-api-documenter-npm-7.23.37-51bf9d9d16.patch",
"@size-limit/file": "^11.1.0",
"@size-limit/webpack": "^11.1.0",
"@size-limit/webpack-why": "^11.1.0",
"size-limit": "^11.1.0"
}
}
Loading

0 comments on commit 270645d

Please sign in to comment.