Skip to content

Commit

Permalink
Merge branch 'main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas authored Sep 14, 2023
2 parents 6cca584 + 9908ab4 commit 2524647
Show file tree
Hide file tree
Showing 508 changed files with 109,160 additions and 50,446 deletions.
3 changes: 3 additions & 0 deletions .attw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignoreRules": ["false-esm", "cjs-resolves-to-esm"]
}
5 changes: 0 additions & 5 deletions .changeset/clever-ravens-juggle.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/shiny-books-roll.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spicy-waves-shake.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/tall-otters-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

For `invariant.log` etc., error arguments are now serialized correctly in the link to the error page.
87 changes: 76 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
version: 2
version: 2.1

jobs:
Filesize:
# Filesize:
# docker:
# - image: cimg/node:20.2.0
# steps:
# - checkout
# - run: npm version
# - run: npm ci
# - run: npm run bundlesize

Lint:
docker:
- image: cimg/node:20.2.0
- image: cimg/node:20.5.1
steps:
- checkout
- run: npm version
- run: npm ci
- run: npm run bundlesize
- run: npm run lint

Lint:
Formatting:
docker:
- image: cimg/node:20.2.0
- image: cimg/node:20.5.1
steps:
- checkout
- run: npm version
- run: npm ci
- run: npm run lint
- run: npm run check:format

Tests:
docker:
- image: cimg/node:20.2.0
- image: cimg/node:20.5.1
steps:
- checkout
- run: npm run ci:precheck
Expand All @@ -37,10 +45,67 @@ jobs:
- store_artifacts:
path: reports/junit

BuildTarball:
docker:
- image: cimg/node:20.5.1
steps:
- checkout
- run: npm run ci:precheck
- run: npm version
- run: npm ci
- run: npm run build && cd dist && mv "$(npm pack --json | jq --raw-output '.[0].filename')" apollo-client.tgz
- persist_to_workspace:
root: dist
paths:
- apollo-client.tgz

IntegrationTests:
parameters:
framework:
type: string
docker:
- image: cimg/node:20.5.1
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run: npm version
- run:
command: npm run ci-preparations --workspace=<< parameters.framework >> --if-present
working_directory: integration-tests
- run:
command: npm install @apollo/client@/tmp/workspace/apollo-client.tgz --workspace=<< parameters.framework >>
working_directory: integration-tests
- run:
command: npx playwright install-deps
working_directory: integration-tests
- run:
command: npm run build --workspace=<< parameters.framework >> --if-present
working_directory: integration-tests
- run:
command: npm run test --workspace=<< parameters.framework >>
working_directory: integration-tests

workflows:
version: 2
Build and Test:
jobs:
- Filesize
# - Filesize
- Tests
- Formatting
- Lint
- BuildTarball
- IntegrationTests:
name: Integration Test << matrix.framework >>
requires:
- BuildTarball
matrix:
parameters:
framework:
- cra4
- cra5
- next
- dual-module-test-esm
- dual-module-test-standard
- vite
- vite-swc
# -browser-esm would need a package publish to npm/CDNs
67 changes: 63 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "import", "local-rules"],
"env": {
"browser": true,
"node": true,
Expand All @@ -9,13 +9,72 @@
"parserOptions": {
"ecmaVersion": "latest"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
}
}
},
"overrides": [
{
"files": ["**/__tests__/**/*.[jt]sx", "**/?(*.)+(test).[jt]sx"],
"files": ["**/*.ts", "**/*.tsx"],
"excludedFiles": ["**/__tests__/**/*.*", "*.d.ts"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"disallowTypeAnnotations": false,
"fixStyle": "separate-type-imports"
}
],
"@typescript-eslint/consistent-type-exports": ["error"],
"@typescript-eslint/no-import-type-side-effects": "error",
"no-restricted-syntax": [
"error",
{
"selector": "ImportDeclaration[source.value='react'][importKind!='type'] :matches(ImportSpecifier, ImportDefaultSpecifier)",
"message": "Please only use the namespace import syntax (`import * as React from 'react'`) for React imports!"
}
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import/extensions": [
"error",
"always",
{
"ignorePackages": true,
"checkTypeImports": true
}
],
"local-rules/require-using-disposable": "error"
}
},
{
"files": [
"**/__tests__/**/*.[jt]s",
"**/__tests__/**/*.[jt]sx",
"**/?(*.)+(test).[jt]s",
"**/?(*.)+(test).[jt]sx"
],
"extends": ["plugin:testing-library/react"],
"parserOptions": {
"project": "./tsconfig.tests.json"
},
"rules": {
"testing-library/prefer-user-event": "error"
"testing-library/prefer-user-event": "error",
"testing-library/no-wait-for-multiple-assertions": "off",
"local-rules/require-using-disposable": "error"
}
}
]
],
"rules": {
"import/no-unresolved": "error"
}
}
11 changes: 10 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# format "ObservableQuery" test
0a67647b73abd94b706242f32b88d21a1400ad50
# format "ObservableQuery" test (in #10597)
104bf11765b1db50292f9656aa8fe48e2d749a83

# format changes from ee0b4ae
f7890ae96a3ba900d3de9bf8b23254bcfba18a25
# Format "DisplayClientError.js" (#10909)
0cb68364f2c3828badde8c74de44e9c1864fb6d4
# Format `react` folder, upgrade to prettier 3.0 (#11111)
ba3e7d9fa7d46e4c636148bbf01552833db0ceda
# Format all non-docs files with prettier (#11170)
352c4a9ad4d140d58850688bd1b2d5513f62c6cb
# Format remaining files from #11170 (#11185)
994ae91f16ea4c8ee28818bd7eaac47e4765c660
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/docs/ @stephenbarlow
/docs/ @apollographql/docs
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
- type: input
attributes:
label: Link to Reproduction
description: A link with runnable reproduction. For web projects, you can fork our `react-apollo-error-template` to create one via [GitHub repository](https://github.com/apollographql/react-apollo-error-template) or [CodeSandbox](https://codesandbox.io/s/github/apollographql/react-apollo-error-template). For React Native projects, you can fork our `rn-apollo-client-testbed` via [GitHub respository](https://github.com/apollographql/rn-apollo-client-testbed). Make sure this includes everything necessary (`package.json`, `tsconfig.json`, etc.) so we don't have to guess anything!
description: "A link with runnable reproduction. For web projects, you can fork our `react-apollo-error-template` to create one via [GitHub repository](https://github.com/apollographql/react-apollo-error-template) or [CodeSandbox](https://codesandbox.io/s/github/apollographql/react-apollo-error-template). For React Native projects, you can fork our `rn-apollo-client-testbed` via [GitHub respository](https://github.com/apollographql/rn-apollo-client-testbed). Make sure this includes everything necessary (`package.json`, `tsconfig.json`, etc.) so we don't have to guess anything! If a minimal reproduction can't be created, please share a [Replay](https://docs.replay.io/workflows/recording-bug-reports) of the bug (note: you don't have to grant Replay access to a private repo to create a recording, but it will contain source maps for your JavaScript code)."
validations:
required: true
- type: textarea
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/arethetypeswrong.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: AreTheTypesWrong
on:
pull_request:
branches:
- main
- release-*

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
arethetypeswrong:
name: Are the types wrong
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies (with cache)
uses: bahmutov/npm-install@v1

- name: Run build
run: npm run build
- name: Run AreTheTypesWrong
id: attw
run: ./node_modules/.bin/attw --format ascii --pack dist > $GITHUB_STEP_SUMMARY
Loading

0 comments on commit 2524647

Please sign in to comment.