diff --git a/.eslintrc.js b/.eslintrc.js index 78bd03279..8549fea0c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,6 +22,14 @@ module.exports = { "testing-library/no-node-access": "off", "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-unused-vars": ["warn", { ignoreRestSiblings: true }], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + prefer: "type-imports", + disallowTypeAnnotations: false, + fixStyle: "separate-type-imports", + }, + ], }, settings: { react: { diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 000000000..0218d01ae --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + + # Install dependencies + - run: npm ci + + # Build and output bunle stats to webpack-stats.json + - run: yarn build --env TARGET=chrome --json webpack-stats.json + + # Upload webpack-stats.json to use on relative-ci.yaml workflow + - name: Upload webpack stats artifact + uses: relative-ci/agent-upload-artifact-action@v1 + with: + webpackStatsFile: ./webpack-stats.json diff --git a/.github/workflows/relative-ci.yaml b/.github/workflows/relative-ci.yaml new file mode 100644 index 000000000..92600e4de --- /dev/null +++ b/.github/workflows/relative-ci.yaml @@ -0,0 +1,17 @@ +name: RelativeCI + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Send bundle stats and build information to RelativeCI + uses: relative-ci/agent-action@v2 + with: + key: ${{ secrets.RELATIVE_CI_KEY }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index ab855770f..4214b6f86 100755 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build !./dist/.gitkeep *.zip .DS_Store -development/server/db.json \ No newline at end of file +development/server/db.json +webpack-stats.json \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a17dda74f..c68547902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 4.8.3 + +### Patch Changes + +- [#1264](https://github.com/apollographql/apollo-client-devtools/pull/1264) [`66c05ae`](https://github.com/apollographql/apollo-client-devtools/commit/66c05ae4cc7231000769e8269e2987ba48c7a779) Thanks [@phryneas](https://github.com/phryneas)! - Enable "@typescript-eslint/consistent-type-imports" lint rule + +- [#1265](https://github.com/apollographql/apollo-client-devtools/pull/1265) [`df5300f`](https://github.com/apollographql/apollo-client-devtools/commit/df5300f245b82e6efc15f616724874fbbb0b8a2d) Thanks [@phryneas](https://github.com/phryneas)! - Use relative-CI to monitor build artefact sizes + +- [#1268](https://github.com/apollographql/apollo-client-devtools/pull/1268) [`4c98879`](https://github.com/apollographql/apollo-client-devtools/commit/4c98879162c918c5b90652609991a5a357ee4f63) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Revert change that removed JSON stringify on the entire set of client data. This is a followup to [#1259](https://github.com/apollographql/apollo-client-devtools/pull/1259) which only partially fixed the issue. + +## 4.8.2 + +### Patch Changes + +- [#1262](https://github.com/apollographql/apollo-client-devtools/pull/1262) [`122c3ee`](https://github.com/apollographql/apollo-client-devtools/commit/122c3ee883cf85078cee6efc31df63e5554c9147) Thanks [@phryneas](https://github.com/phryneas)! - prevent bundling Apollo Client in the hooks.js build + +- [#1259](https://github.com/apollographql/apollo-client-devtools/pull/1259) [`de55e20`](https://github.com/apollographql/apollo-client-devtools/commit/de55e2079d17de4e6bdc67582d0a22e577294dfd) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue when sending cache data from the browser to the extension. This was particularly problematic when the cache contained `URL` instances which are not cloneable via the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) + ## 4.8.1 ### Patch Changes diff --git a/package-lock.json b/package-lock.json index 0f33dcb95..44ea42dc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "apollo-client-devtools", - "version": "4.8.1", + "version": "4.8.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "apollo-client-devtools", - "version": "4.8.1", + "version": "4.8.3", "license": "MIT", "dependencies": { "@apollo/brand": "^0.5.0", @@ -54,7 +54,7 @@ "@types/zen-observable": "0.8.7", "@typescript-eslint/eslint-plugin": "7.1.1", "@typescript-eslint/parser": "7.1.1", - "archiver": "7.0.0", + "archiver": "7.0.1", "autoprefixer": "10.4.18", "copy-webpack-plugin": "12.0.2", "css-loader": "6.10.0", @@ -9569,35 +9569,36 @@ } }, "node_modules/archiver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.0.tgz", - "integrity": "sha512-R9HM9egs8FfktSqUqyjlKmvF4U+CWNqm/2tlROV+lOFg79MLdT67ae1l3hU47pGy8twSXxHoiefMCh43w0BriQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz", + "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==", "dev": true, "dependencies": { - "archiver-utils": "^5.0.0", + "archiver-utils": "^5.0.2", "async": "^3.2.4", "buffer-crc32": "^1.0.0", "readable-stream": "^4.0.0", "readdir-glob": "^1.1.2", "tar-stream": "^3.0.0", - "zip-stream": "^6.0.0" + "zip-stream": "^6.0.1" }, "engines": { "node": ">= 14" } }, "node_modules/archiver-utils": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.1.tgz", - "integrity": "sha512-MMAoLdMvT/nckofX1tCLrf7uJce4jTNkiT6smA2u57AOImc1nce7mR3EDujxL5yv6/MnILuQH4sAsPtDS8kTvg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz", + "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==", "dev": true, "dependencies": { "glob": "^10.0.0", "graceful-fs": "^4.2.0", + "is-stream": "^2.0.1", "lazystream": "^1.0.0", "lodash": "^4.17.15", "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" + "readable-stream": "^4.0.0" }, "engines": { "node": ">= 14" @@ -9650,17 +9651,48 @@ } }, "node_modules/archiver-utils/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" }, "engines": { - "node": ">= 6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/archiver-utils/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/archiver-utils/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" } }, "node_modules/archiver/node_modules/buffer-crc32": { @@ -11365,13 +11397,14 @@ } }, "node_modules/compress-commons": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.1.tgz", - "integrity": "sha512-l7occIJn8YwlCEbWUCrG6gPms9qnJTCZSaznCa5HaV+yJMH4kM8BDc7q9NyoQuoiB2O6jKgTcTeY462qw6MyHw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz", + "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==", "dev": true, "dependencies": { "crc-32": "^1.2.0", "crc32-stream": "^6.0.0", + "is-stream": "^2.0.1", "normalize-path": "^3.0.0", "readable-stream": "^4.0.0" }, @@ -25767,13 +25800,13 @@ } }, "node_modules/zip-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.0.tgz", - "integrity": "sha512-X0WFquRRDtL9HR9hc1OrabOP/VKJEX7gAr2geayt3b7dLgXgSXI6ucC4CphLQP/aQt2GyHIYgmXxtC+dVdghAQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz", + "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==", "dev": true, "dependencies": { "archiver-utils": "^5.0.0", - "compress-commons": "^6.0.0", + "compress-commons": "^6.0.2", "readable-stream": "^4.0.0" }, "engines": { diff --git a/package.json b/package.json index 5bc4713d0..513dea65e 100755 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "apollo-client-devtools", "description": "Developer tools for Apollo Client, with Studio Explorer integration, cache inspection, and query watching.", "license": "MIT", - "version": "4.8.1", + "version": "4.8.3", "repository": { "type": "git", "url": "git+https://github.com/apollographql/apollo-client-devtools.git" @@ -80,7 +80,7 @@ "@types/zen-observable": "0.8.7", "@typescript-eslint/eslint-plugin": "7.1.1", "@typescript-eslint/parser": "7.1.1", - "archiver": "7.0.0", + "archiver": "7.0.1", "autoprefixer": "10.4.18", "copy-webpack-plugin": "12.0.2", "css-loader": "6.10.0", diff --git a/src/@types/svg.d.ts b/src/@types/svg.d.ts index bbac48480..8f4806e72 100644 --- a/src/@types/svg.d.ts +++ b/src/@types/svg.d.ts @@ -1,5 +1,5 @@ declare module "*.svg" { - import * as React from "react"; + import type * as React from "react"; export const ReactComponent: React.FunctionComponent< React.SVGProps & { title?: string } diff --git a/src/application/App.tsx b/src/application/App.tsx index 1858e36cc..d83b1839c 100644 --- a/src/application/App.tsx +++ b/src/application/App.tsx @@ -1,27 +1,26 @@ import { useEffect, useState, useRef } from "react"; -import { - useReactiveVar, - gql, - useQuery, - makeVar, - TypedDocumentNode, -} from "@apollo/client"; +import type { TypedDocumentNode } from "@apollo/client"; +import { useReactiveVar, gql, useQuery, makeVar } from "@apollo/client"; import { currentScreen, Screens } from "./components/Layouts/Navigation"; import { Queries } from "./components/Queries/Queries"; import { Mutations } from "./components/Mutations/Mutations"; import { Explorer } from "./components/Explorer/Explorer"; import { Cache } from "./components/Cache/Cache"; -import { GetOperationCounts, GetOperationCountsVariables } from "./types/gql"; +import type { + GetOperationCounts, + GetOperationCountsVariables, +} from "./types/gql"; import { Tabs } from "./components/Tabs"; import { Button } from "./components/Button"; import IconSettings from "@apollo/icons/default/IconSettings.svg"; import IconSync from "@apollo/icons/small/IconSync.svg"; import { SettingsModal } from "./components/Layouts/SettingsModal"; import Logo from "@apollo/icons/logos/LogoSymbol.svg"; -import { BannerAlert, BannerAlertConfig } from "./components/BannerAlert"; -import { GetStates } from "./stateMachine"; -import { DevtoolsMachine } from "./machines"; +import type { BannerAlertConfig } from "./components/BannerAlert"; +import { BannerAlert } from "./components/BannerAlert"; +import type { GetStates } from "./stateMachine"; +import type { DevtoolsMachine } from "./machines"; import { ClientNotFoundModal } from "./components/ClientNotFoundModal"; import { getPanelActor } from "../extension/devtools/panelActor"; diff --git a/src/application/__tests__/AppProvider.test.tsx b/src/application/__tests__/AppProvider.test.tsx index 502cd0dbe..71192834f 100644 --- a/src/application/__tests__/AppProvider.test.tsx +++ b/src/application/__tests__/AppProvider.test.tsx @@ -5,7 +5,7 @@ import { gql } from "@apollo/client"; import matchMediaMock from "../utilities/testing/matchMedia"; import { Mode, colorTheme } from "../theme"; import { AppProvider, getQueryData, getMutationData } from "../index"; -import { QueryInfo } from "../../extension/tab/helpers"; +import type { QueryInfo } from "../../extension/tab/helpers"; import { print, getIntrospectionQuery } from "graphql"; const matchMedia = matchMediaMock(); diff --git a/src/application/components/BannerAlert.tsx b/src/application/components/BannerAlert.tsx index 4f1a42c4b..bd9e46720 100644 --- a/src/application/components/BannerAlert.tsx +++ b/src/application/components/BannerAlert.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; import { makeVar, useReactiveVar } from "@apollo/client"; -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { LoadingSpinner } from "./Explorer/LoadingSpinner"; import IconCheck from "@apollo/icons/default/IconCheck.svg"; import IconError from "@apollo/icons/default/IconError.svg"; diff --git a/src/application/components/Button.tsx b/src/application/components/Button.tsx index 4701499dd..08b7a0b7c 100644 --- a/src/application/components/Button.tsx +++ b/src/application/components/Button.tsx @@ -1,4 +1,4 @@ -import { ComponentPropsWithoutRef, ElementType } from "react"; +import type { ComponentPropsWithoutRef, ElementType } from "react"; import { clsx } from "clsx"; type NativeButtonProps = ComponentPropsWithoutRef<"button">; diff --git a/src/application/components/ButtonGroup.tsx b/src/application/components/ButtonGroup.tsx index 9897a9a6d..a9d354c67 100644 --- a/src/application/components/ButtonGroup.tsx +++ b/src/application/components/ButtonGroup.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; interface ButtonGroupProps { children: ReactNode; diff --git a/src/application/components/Cache/Cache.tsx b/src/application/components/Cache/Cache.tsx index f8b6ab85d..1cc4ef8bd 100644 --- a/src/application/components/Cache/Cache.tsx +++ b/src/application/components/Cache/Cache.tsx @@ -1,12 +1,14 @@ -import { Fragment, useState, useMemo, ReactNode } from "react"; -import { gql, useQuery, TypedDocumentNode } from "@apollo/client"; +import type { ReactNode } from "react"; +import { Fragment, useState, useMemo } from "react"; +import type { TypedDocumentNode } from "@apollo/client"; +import { gql, useQuery } from "@apollo/client"; import { SidebarLayout } from "../Layouts/SidebarLayout"; import { SearchField } from "../SearchField"; import { EntityList } from "./sidebar/EntityList"; import { Loading } from "./common/Loading"; -import { GetCache, GetCacheVariables } from "../../types/gql"; -import { JSONObject } from "../../types/json"; +import type { GetCache, GetCacheVariables } from "../../types/gql"; +import type { JSONObject } from "../../types/json"; import { JSONTreeViewer } from "../JSONTreeViewer"; import clsx from "clsx"; import { CopyButton } from "../CopyButton"; diff --git a/src/application/components/Cache/common/utils.ts b/src/application/components/Cache/common/utils.ts index 161ee25e2..7371b6e5c 100644 --- a/src/application/components/Cache/common/utils.ts +++ b/src/application/components/Cache/common/utils.ts @@ -1,4 +1,4 @@ -import { JSONObject } from "../../../types/json"; +import type { JSONObject } from "../../../types/json"; // Return an alphabetically sorted list of all root cache ID's. ROOT_QUERY, // ROOT_MUTATION, and ROOT_SUBSCRIPTION will be listed first (if they exist). diff --git a/src/application/components/Cache/sidebar/EntityList.tsx b/src/application/components/Cache/sidebar/EntityList.tsx index 8622a1279..644b36695 100644 --- a/src/application/components/Cache/sidebar/EntityList.tsx +++ b/src/application/components/Cache/sidebar/EntityList.tsx @@ -2,7 +2,7 @@ import { List } from "../../List"; import { ListItem } from "../../ListItem"; import { getRootCacheIds } from "../common/utils"; -import { JSONObject } from "../../../types/json"; +import type { JSONObject } from "../../../types/json"; import HighlightMatch from "../../HighlightMatch"; interface EntityListProps { diff --git a/src/application/components/CodeBlock.tsx b/src/application/components/CodeBlock.tsx index 047c0c374..f271887d3 100644 --- a/src/application/components/CodeBlock.tsx +++ b/src/application/components/CodeBlock.tsx @@ -1,4 +1,5 @@ -import { Highlight, Language, PrismTheme } from "prism-react-renderer"; +import type { Language, PrismTheme } from "prism-react-renderer"; +import { Highlight } from "prism-react-renderer"; import { useReactiveVar } from "@apollo/client"; import { colors } from "@apollo/brand"; import { clsx } from "clsx"; diff --git a/src/application/components/CopyButton.tsx b/src/application/components/CopyButton.tsx index 8015546a7..f2f0425b2 100644 --- a/src/application/components/CopyButton.tsx +++ b/src/application/components/CopyButton.tsx @@ -1,4 +1,4 @@ -import { ComponentPropsWithoutRef } from "react"; +import type { ComponentPropsWithoutRef } from "react"; import clsx from "clsx"; import CopyToClipboard from "react-copy-to-clipboard"; import { Button } from "./Button"; diff --git a/src/application/components/Disclosure/Button.tsx b/src/application/components/Disclosure/Button.tsx index 707920179..4554ef40c 100644 --- a/src/application/components/Disclosure/Button.tsx +++ b/src/application/components/Disclosure/Button.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Disclosure } from "@headlessui/react"; import IconChevronUp from "@apollo/icons/default/IconChevronUp.svg"; import clsx from "clsx"; diff --git a/src/application/components/Disclosure/Disclosure.tsx b/src/application/components/Disclosure/Disclosure.tsx index 5cc90f3da..2492a6347 100644 --- a/src/application/components/Disclosure/Disclosure.tsx +++ b/src/application/components/Disclosure/Disclosure.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Disclosure as DisclosureRoot } from "@headlessui/react"; import { DisclosureButton } from "./Button"; import { DisclosurePanel } from "./Panel"; diff --git a/src/application/components/Disclosure/Panel.tsx b/src/application/components/Disclosure/Panel.tsx index 7bd550177..39e96b292 100644 --- a/src/application/components/Disclosure/Panel.tsx +++ b/src/application/components/Disclosure/Panel.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Disclosure, Transition } from "@headlessui/react"; interface DisclosurePanelProps { diff --git a/src/application/components/Explorer/Explorer.tsx b/src/application/components/Explorer/Explorer.tsx index b79564e5a..36f8e5b78 100644 --- a/src/application/components/Explorer/Explorer.tsx +++ b/src/application/components/Explorer/Explorer.tsx @@ -5,7 +5,8 @@ import type { IntrospectionQuery } from "graphql"; import { getIntrospectionQuery } from "graphql/utilities"; import { colorTheme } from "../../theme"; import { FullWidthLayout } from "../Layouts/FullWidthLayout"; -import { QueryResult } from "../../../types"; +import type { QueryResult } from "../../../types"; +import type { JSONValue, IncomingMessageEvent } from "./postMessageHelpers"; import { postMessageToEmbed, EMBEDDABLE_EXPLORER_URL, @@ -14,10 +15,8 @@ import { EXPLORER_SUBSCRIPTION_REQUEST, EXPLORER_SUBSCRIPTION_RESPONSE, EXPLORER_SUBSCRIPTION_TERMINATION, - JSONValue, SCHEMA_ERROR, SCHEMA_RESPONSE, - IncomingMessageEvent, } from "./postMessageHelpers"; import { EXPLORER_LISTENING_FOR_HANDSHAKE, diff --git a/src/application/components/Explorer/GraphRefModal.tsx b/src/application/components/Explorer/GraphRefModal.tsx index ed884ca3b..3fbe9f506 100644 --- a/src/application/components/Explorer/GraphRefModal.tsx +++ b/src/application/components/Explorer/GraphRefModal.tsx @@ -1,4 +1,5 @@ -import React, { useState } from "react"; +import type React from "react"; +import { useState } from "react"; import { clsx } from "clsx"; import { LoadingSpinner } from "./LoadingSpinner"; import { hasGraphRefBeenAuthenticated } from "./postMessageAuthHelpers"; diff --git a/src/application/components/Explorer/Telescope.tsx b/src/application/components/Explorer/Telescope.tsx index 3dbaa17a6..c7e319d44 100644 --- a/src/application/components/Explorer/Telescope.tsx +++ b/src/application/components/Explorer/Telescope.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import type React from "react"; interface TelescopeProps { className?: string; diff --git a/src/application/components/Explorer/postMessageAuthHelpers.ts b/src/application/components/Explorer/postMessageAuthHelpers.ts index 89a1dd1a9..f43673fe4 100644 --- a/src/application/components/Explorer/postMessageAuthHelpers.ts +++ b/src/application/components/Explorer/postMessageAuthHelpers.ts @@ -1,4 +1,5 @@ -import { IncomingMessageEvent, postMessageToEmbed } from "./postMessageHelpers"; +import type { IncomingMessageEvent } from "./postMessageHelpers"; +import { postMessageToEmbed } from "./postMessageHelpers"; export const SET_PARTIAL_AUTHENTICATION_TOKEN_FOR_PARENT = "SetPartialAuthenticationTokenForParent"; diff --git a/src/application/components/GitHubIssueLink.tsx b/src/application/components/GitHubIssueLink.tsx index af41a7e0f..877b32c5e 100644 --- a/src/application/components/GitHubIssueLink.tsx +++ b/src/application/components/GitHubIssueLink.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; declare const VERSION: string; diff --git a/src/application/components/JSONTreeViewer.tsx b/src/application/components/JSONTreeViewer.tsx index 8a13df7eb..04d1b20db 100644 --- a/src/application/components/JSONTreeViewer.tsx +++ b/src/application/components/JSONTreeViewer.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, ComponentPropsWithoutRef } from "react"; +import type { CSSProperties, ComponentPropsWithoutRef } from "react"; import { useReactiveVar } from "@apollo/client"; import { JSONTree } from "react-json-tree"; import { ColorTheme, colorTheme } from "../theme"; diff --git a/src/application/components/Layouts/FullWidthLayout.tsx b/src/application/components/Layouts/FullWidthLayout.tsx index 12f7b0c48..31146a806 100644 --- a/src/application/components/Layouts/FullWidthLayout.tsx +++ b/src/application/components/Layouts/FullWidthLayout.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { clsx } from "clsx"; interface FullWidthLayoutProps { diff --git a/src/application/components/Layouts/SidebarLayout.tsx b/src/application/components/Layouts/SidebarLayout.tsx index 5c50ec8ba..09eaef262 100644 --- a/src/application/components/Layouts/SidebarLayout.tsx +++ b/src/application/components/Layouts/SidebarLayout.tsx @@ -1,5 +1,5 @@ import clsx from "clsx"; -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { PanelGroup, Panel, PanelResizeHandle } from "react-resizable-panels"; interface SidebarLayoutProps { diff --git a/src/application/components/List.tsx b/src/application/components/List.tsx index 36b76e791..b75ccc0c2 100644 --- a/src/application/components/List.tsx +++ b/src/application/components/List.tsx @@ -1,4 +1,4 @@ -import { ComponentPropsWithoutRef } from "react"; +import type { ComponentPropsWithoutRef } from "react"; import clsx from "clsx"; type ListProps = ComponentPropsWithoutRef<"div">; diff --git a/src/application/components/ListItem.tsx b/src/application/components/ListItem.tsx index 3a255976c..5282acd00 100644 --- a/src/application/components/ListItem.tsx +++ b/src/application/components/ListItem.tsx @@ -1,4 +1,4 @@ -import { ReactNode, ComponentPropsWithoutRef } from "react"; +import type { ReactNode, ComponentPropsWithoutRef } from "react"; import { clsx } from "clsx"; interface ListItemProps { diff --git a/src/application/components/Modal/Body.tsx b/src/application/components/Modal/Body.tsx index fda525e09..c20dfe99e 100644 --- a/src/application/components/Modal/Body.tsx +++ b/src/application/components/Modal/Body.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { clsx } from "clsx"; interface BodyProps { diff --git a/src/application/components/Modal/Footer.tsx b/src/application/components/Modal/Footer.tsx index 820f3ea11..9adfd6190 100644 --- a/src/application/components/Modal/Footer.tsx +++ b/src/application/components/Modal/Footer.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { clsx } from "clsx"; interface FooterProps { diff --git a/src/application/components/Modal/Header.tsx b/src/application/components/Modal/Header.tsx index ad27308d1..cdbba0b76 100644 --- a/src/application/components/Modal/Header.tsx +++ b/src/application/components/Modal/Header.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { clsx } from "clsx"; interface HeaderProps { diff --git a/src/application/components/Modal/Modal.tsx b/src/application/components/Modal/Modal.tsx index 3f7dfe4a8..873b42983 100644 --- a/src/application/components/Modal/Modal.tsx +++ b/src/application/components/Modal/Modal.tsx @@ -1,5 +1,6 @@ import { Dialog, Transition } from "@headlessui/react"; -import { Fragment, ReactNode } from "react"; +import type { ReactNode } from "react"; +import { Fragment } from "react"; import { clsx } from "clsx"; import { Body } from "./Body"; diff --git a/src/application/components/Modal/Title.tsx b/src/application/components/Modal/Title.tsx index 3ff4cb9da..1e3efe63d 100644 --- a/src/application/components/Modal/Title.tsx +++ b/src/application/components/Modal/Title.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Dialog } from "@headlessui/react"; import { clsx } from "clsx"; diff --git a/src/application/components/Mutations/Mutations.tsx b/src/application/components/Mutations/Mutations.tsx index 6949092ed..41c9575f4 100644 --- a/src/application/components/Mutations/Mutations.tsx +++ b/src/application/components/Mutations/Mutations.tsx @@ -1,11 +1,12 @@ import { Fragment, useState } from "react"; -import { gql, TypedDocumentNode, useQuery } from "@apollo/client"; +import type { TypedDocumentNode } from "@apollo/client"; +import { gql, useQuery } from "@apollo/client"; import { List } from "../List"; import { ListItem } from "../ListItem"; import { SidebarLayout } from "../Layouts/SidebarLayout"; import { RunInExplorerButton } from "../Queries/RunInExplorerButton"; -import { GetMutations, GetMutationsVariables } from "../../types/gql"; +import type { GetMutations, GetMutationsVariables } from "../../types/gql"; import { JSONTreeViewer } from "../JSONTreeViewer"; import { Tabs } from "../Tabs"; import { QueryLayout } from "../QueryLayout"; diff --git a/src/application/components/Queries/Queries.tsx b/src/application/components/Queries/Queries.tsx index 527c7c5f3..5b0bb5aa0 100644 --- a/src/application/components/Queries/Queries.tsx +++ b/src/application/components/Queries/Queries.tsx @@ -1,11 +1,15 @@ import { useState } from "react"; -import { gql, useQuery, TypedDocumentNode } from "@apollo/client"; +import type { TypedDocumentNode } from "@apollo/client"; +import { gql, useQuery } from "@apollo/client"; import { List } from "../List"; import { ListItem } from "../ListItem"; import { SidebarLayout } from "../Layouts/SidebarLayout"; import { RunInExplorerButton } from "./RunInExplorerButton"; -import { GetWatchedQueries, GetWatchedQueriesVariables } from "../../types/gql"; +import type { + GetWatchedQueries, + GetWatchedQueriesVariables, +} from "../../types/gql"; import { Tabs } from "../Tabs"; import { JSONTreeViewer } from "../JSONTreeViewer"; import { QueryLayout } from "../QueryLayout"; diff --git a/src/application/components/Queries/RunInExplorerButton.tsx b/src/application/components/Queries/RunInExplorerButton.tsx index 3928c0d82..1e0a7fffa 100644 --- a/src/application/components/Queries/RunInExplorerButton.tsx +++ b/src/application/components/Queries/RunInExplorerButton.tsx @@ -1,4 +1,4 @@ -import { Variables } from "../../types/scalars"; +import type { Variables } from "../../types/scalars"; import { postMessageToEmbed, SET_OPERATION, diff --git a/src/application/components/QueryLayout/Header.tsx b/src/application/components/QueryLayout/Header.tsx index a7cf09fbb..59f16d0aa 100644 --- a/src/application/components/QueryLayout/Header.tsx +++ b/src/application/components/QueryLayout/Header.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; interface HeaderProps { children: ReactNode; diff --git a/src/application/components/QueryLayout/QueryLayout.tsx b/src/application/components/QueryLayout/QueryLayout.tsx index beaf3164b..971f98119 100644 --- a/src/application/components/QueryLayout/QueryLayout.tsx +++ b/src/application/components/QueryLayout/QueryLayout.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { clsx } from "clsx"; import { SidebarLayout } from "../Layouts/SidebarLayout"; diff --git a/src/application/components/QueryLayout/TabContent.tsx b/src/application/components/QueryLayout/TabContent.tsx index b3d38fa05..aa0d676cc 100644 --- a/src/application/components/QueryLayout/TabContent.tsx +++ b/src/application/components/QueryLayout/TabContent.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Tabs } from "../Tabs"; interface TabContentProps { diff --git a/src/application/components/QueryLayout/Tabs.tsx b/src/application/components/QueryLayout/Tabs.tsx index c01fdfc5a..c2f7a823a 100644 --- a/src/application/components/QueryLayout/Tabs.tsx +++ b/src/application/components/QueryLayout/Tabs.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Tabs as TabsBase } from "../Tabs"; interface TabsProps { diff --git a/src/application/components/QueryLayout/Title.tsx b/src/application/components/QueryLayout/Title.tsx index 9b7d52aa4..41968aaaa 100644 --- a/src/application/components/QueryLayout/Title.tsx +++ b/src/application/components/QueryLayout/Title.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; interface TitleProps { children: ReactNode; diff --git a/src/application/components/Tabs/Content.tsx b/src/application/components/Tabs/Content.tsx index b1ca406a0..b30c930d4 100644 --- a/src/application/components/Tabs/Content.tsx +++ b/src/application/components/Tabs/Content.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Content as ContentBase } from "@radix-ui/react-tabs"; import clsx from "clsx"; diff --git a/src/application/components/Tabs/List.tsx b/src/application/components/Tabs/List.tsx index 51156afa6..70df3dfe7 100644 --- a/src/application/components/Tabs/List.tsx +++ b/src/application/components/Tabs/List.tsx @@ -1,5 +1,5 @@ import { List as ListBase } from "@radix-ui/react-tabs"; -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { clsx } from "clsx"; interface ListProps { diff --git a/src/application/components/Tabs/Tabs.tsx b/src/application/components/Tabs/Tabs.tsx index c79f6c093..b8d557c81 100644 --- a/src/application/components/Tabs/Tabs.tsx +++ b/src/application/components/Tabs/Tabs.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Root } from "@radix-ui/react-tabs"; import clsx from "clsx"; diff --git a/src/application/components/Tabs/Trigger.tsx b/src/application/components/Tabs/Trigger.tsx index 149097082..b7379694c 100644 --- a/src/application/components/Tabs/Trigger.tsx +++ b/src/application/components/Tabs/Trigger.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Trigger as TriggerBase } from "@radix-ui/react-tabs"; interface TriggerProps { diff --git a/src/application/components/TextField.tsx b/src/application/components/TextField.tsx index dcdab9560..f0bf0619a 100644 --- a/src/application/components/TextField.tsx +++ b/src/application/components/TextField.tsx @@ -1,7 +1,7 @@ -import { ComponentPropsWithoutRef } from "react"; +import type { ComponentPropsWithoutRef } from "react"; import { clsx } from "clsx"; -import { ExtendProps } from "../types/props"; +import type { ExtendProps } from "../types/props"; type TextFieldProps = ExtendProps< ComponentPropsWithoutRef<"input">, diff --git a/src/application/index.tsx b/src/application/index.tsx index 268df6c35..714fd1a41 100755 --- a/src/application/index.tsx +++ b/src/application/index.tsx @@ -1,12 +1,12 @@ import { useEffect } from "react"; import { createRoot } from "react-dom/client"; +import type { TypedDocumentNode } from "@apollo/client"; import { ApolloClient, ApolloProvider, InMemoryCache, makeVar, gql, - TypedDocumentNode, } from "@apollo/client"; import { getOperationName } from "@apollo/client/utilities"; import { print } from "graphql/language/printer"; @@ -15,7 +15,7 @@ import { colorTheme, listenForThemeChange } from "./theme"; import { App } from "./App"; import { fragmentRegistry } from "./fragmentRegistry"; -import { +import type { GetAllMutations, GetAllMutationsVariables, GetQueries, @@ -23,7 +23,8 @@ import { WatchedMutation, WatchedQuery, } from "./types/gql"; -import { QueryInfo } from "../extension/tab/helpers"; +import type { QueryInfo } from "../extension/tab/helpers"; +import type { JSONObject } from "./types/json"; const cache = new InMemoryCache({ fragments: fragmentRegistry, @@ -152,7 +153,7 @@ export const writeData = ({ }: { queries: QueryInfo[]; mutations: QueryInfo[]; - cache: Record; + cache: JSONObject; }) => { const filteredQueries = queries.map(getQueryData).filter(Boolean); diff --git a/src/application/machines.ts b/src/application/machines.ts index 1c238b2cb..eaa8ddffe 100644 --- a/src/application/machines.ts +++ b/src/application/machines.ts @@ -1,6 +1,6 @@ import { createMachine } from "./stateMachine"; -import { QueryInfo } from "../extension/tab/helpers"; -import { JSONObject } from "./types/json"; +import type { QueryInfo } from "../extension/tab/helpers"; +import type { JSONObject } from "./types/json"; export const devtoolsMachine = createMachine({ initial: "initialized", diff --git a/src/application/stateMachine.ts b/src/application/stateMachine.ts index 542d0930c..ebb2fffdf 100644 --- a/src/application/stateMachine.ts +++ b/src/application/stateMachine.ts @@ -1,4 +1,4 @@ -import { NoInfer, SafeAny } from "../types"; +import type { NoInfer, SafeAny } from "../types"; interface Machine< State extends string, diff --git a/src/application/types/gql.ts b/src/application/types/gql.ts index e233e8181..dc812d14c 100644 --- a/src/application/types/gql.ts +++ b/src/application/types/gql.ts @@ -1,5 +1,5 @@ -import { QueryData } from "./scalars"; -import { Variables } from "./scalars"; +import type { QueryData } from "./scalars"; +import type { Variables } from "./scalars"; export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { diff --git a/src/application/types/scalars.ts b/src/application/types/scalars.ts index 8d81e7683..16e7fd503 100644 --- a/src/application/types/scalars.ts +++ b/src/application/types/scalars.ts @@ -1,4 +1,4 @@ -import { JSONObject } from "./json"; +import type { JSONObject } from "./json"; export type Variables = JSONObject; export type QueryData = JSONObject; diff --git a/src/application/utilities/testing/fakeGraphQL.ts b/src/application/utilities/testing/fakeGraphQL.ts index eee19ac09..876bc770c 100644 --- a/src/application/utilities/testing/fakeGraphQL.ts +++ b/src/application/utilities/testing/fakeGraphQL.ts @@ -1,6 +1,6 @@ import { makeExecutableSchema } from "@graphql-tools/schema"; import { addMocksToSchema } from "@graphql-tools/mock"; -import { GraphQLFieldResolver } from "graphql"; +import type { GraphQLFieldResolver } from "graphql"; interface Author { id: number; diff --git a/src/application/utilities/testing/renderWithApolloClient.tsx b/src/application/utilities/testing/renderWithApolloClient.tsx index 18b6550a1..83300c783 100644 --- a/src/application/utilities/testing/renderWithApolloClient.tsx +++ b/src/application/utilities/testing/renderWithApolloClient.tsx @@ -1,4 +1,4 @@ -import { ReactElement } from "react"; +import type { ReactElement } from "react"; import { render } from "@testing-library/react"; import { ApolloProvider } from "@apollo/client"; import userEvent from "@testing-library/user-event"; diff --git a/src/extension/actor.ts b/src/extension/actor.ts index 6fc209471..20849235f 100644 --- a/src/extension/actor.ts +++ b/src/extension/actor.ts @@ -1,12 +1,12 @@ -import browser from "webextension-polyfill"; +import type browser from "webextension-polyfill"; import type { ApolloClientDevtoolsEventMessage, MessageFormat, } from "./messages"; import { MessageType, isEventMessage } from "./messages"; -import { NoInfer } from "../types"; +import type { NoInfer } from "../types"; +import type { MessageAdapter } from "./messageAdapters"; import { - MessageAdapter, createPortMessageAdapter, createWindowMessageAdapter, } from "./messageAdapters"; diff --git a/src/extension/chrome/manifest.json b/src/extension/chrome/manifest.json index 6502e5c4d..935a43e52 100644 --- a/src/extension/chrome/manifest.json +++ b/src/extension/chrome/manifest.json @@ -1,5 +1,5 @@ { - "version": "4.8.1", + "version": "4.8.3", "author": "Apollo", "name": "Apollo Client Devtools", "description": "GraphQL debugging tools for Apollo Client.", diff --git a/src/extension/devtools/devtools.ts b/src/extension/devtools/devtools.ts index 4a1563bc0..5189be01f 100755 --- a/src/extension/devtools/devtools.ts +++ b/src/extension/devtools/devtools.ts @@ -1,7 +1,12 @@ import browser from "webextension-polyfill"; import { devtoolsMachine } from "../../application/machines"; -import { Actor, createActor } from "../actor"; -import { ClientMessage, DevtoolsRPCMessage, PanelMessage } from "../messages"; +import type { Actor } from "../actor"; +import { createActor } from "../actor"; +import type { + ClientMessage, + DevtoolsRPCMessage, + PanelMessage, +} from "../messages"; import { getPanelActor } from "./panelActor"; import { createPortMessageAdapter } from "../messageAdapters"; import { createRpcClient } from "../rpc"; diff --git a/src/extension/devtools/panelActor.ts b/src/extension/devtools/panelActor.ts index e847564eb..56f7f7285 100644 --- a/src/extension/devtools/panelActor.ts +++ b/src/extension/devtools/panelActor.ts @@ -1,5 +1,6 @@ -import { Actor, createWindowActor } from "../actor"; -import { PanelMessage } from "../messages"; +import type { Actor } from "../actor"; +import { createWindowActor } from "../actor"; +import type { PanelMessage } from "../messages"; let panelActor: Actor | null = null; diff --git a/src/extension/firefox/manifest.json b/src/extension/firefox/manifest.json index 09e004183..8849d1719 100644 --- a/src/extension/firefox/manifest.json +++ b/src/extension/firefox/manifest.json @@ -1,5 +1,5 @@ { - "version": "4.8.1", + "version": "4.8.3", "author": "Apollo", "name": "Apollo Client Devtools", "description": "GraphQL debugging tools for Apollo Client.", diff --git a/src/extension/messages.ts b/src/extension/messages.ts index 9ea6be5dc..51b7b5ef0 100644 --- a/src/extension/messages.ts +++ b/src/extension/messages.ts @@ -1,6 +1,6 @@ -import { ExplorerResponse } from "../types"; -import { GetStates, GetContext } from "../application/stateMachine"; -import { DevtoolsMachine } from "../application/machines"; +import type { ExplorerResponse } from "../types"; +import type { GetStates, GetContext } from "../application/stateMachine"; +import type { DevtoolsMachine } from "../application/machines"; export interface MessageFormat { type: string; diff --git a/src/extension/tab/helpers.ts b/src/extension/tab/helpers.ts index 3c58ec638..06db46a90 100644 --- a/src/extension/tab/helpers.ts +++ b/src/extension/tab/helpers.ts @@ -5,7 +5,7 @@ import type { OperationDefinitionNode, FragmentDefinitionNode, } from "graphql/language"; -import { QueryData, Variables } from "../../application/types/scalars"; +import type { QueryData, Variables } from "../../application/types/scalars"; import { getPrivateAccess } from "../../privateAccess"; export type QueryInfo = { diff --git a/src/extension/tab/hook.ts b/src/extension/tab/hook.ts index 09a26c882..8184e02f5 100755 --- a/src/extension/tab/hook.ts +++ b/src/extension/tab/hook.ts @@ -1,33 +1,28 @@ -import { - ApolloClient, - ApolloError, - DocumentNode, - NetworkStatus, -} from "@apollo/client"; +import type { ApolloClient, ApolloError, DocumentNode } from "@apollo/client"; // Note that we are intentionally not using Apollo Client's gql and // Observable exports, as we don't want Apollo Client and its dependencies // to be loaded into each browser tab, when this hook triggered. import gql from "graphql-tag"; import Observable from "zen-observable"; -import { OperationDefinitionNode } from "graphql/language"; +import type { OperationDefinitionNode } from "graphql/language"; // All manifests should contain the same version number so it shouldn't matter // which one we import from. import { version as devtoolsVersion } from "../chrome/manifest.json"; +import type { QueryInfo } from "./helpers"; import { - QueryInfo, getQueries, getQueriesLegacy, getMutations, getMainDefinition, } from "./helpers"; -import { QueryResult } from "../../types"; +import type { QueryResult } from "../../types"; import { getPrivateAccess } from "../../privateAccess"; -import { JSONObject } from "../../application/types/json"; -import { FetchPolicy } from "../../application/components/Explorer/Explorer"; +import type { JSONObject } from "../../application/types/json"; +import type { FetchPolicy } from "../../application/components/Explorer/Explorer"; import { createWindowActor } from "../actor"; -import { ClientMessage, DevtoolsRPCMessage } from "../messages"; +import type { ClientMessage, DevtoolsRPCMessage } from "../messages"; import { createWindowMessageAdapter } from "../messageAdapters"; import { createRpcHandler } from "../rpc"; @@ -112,11 +107,21 @@ function initializeHook() { function sendHookDataToDevTools(eventName: "connectToDevtools") { tab.send({ type: eventName, - payload: { - queries: hook.getQueries(), - mutations: hook.getMutations(), - cache: hook.getCache(), - }, + // We need to JSON stringify the data here in case the cache contains + // references to irregular data such as `URL` instances which are not + // cloneable via `structuredClone` (which `window.postMessage` uses to + // send messages). `JSON.stringify` does however serialize `URL`s into + // strings properly, so this should ensure that the cache data will be + // sent without errors. + // + // https://github.com/apollographql/apollo-client-devtools/issues/1258 + payload: JSON.parse( + JSON.stringify({ + queries: hook.getQueries(), + mutations: hook.getMutations(), + cache: hook.getCache(), + }) + ) as { queries: QueryInfo[]; mutations: QueryInfo[]; cache: JSONObject }, }); } @@ -209,7 +214,7 @@ function initializeHook() { error: error, data: null, loading: false, - networkStatus: NetworkStatus.error, + networkStatus: 8, // NetworkStatus.error - we want to prevent importing the enum here }, }, }); diff --git a/src/extension/tab/tab.ts b/src/extension/tab/tab.ts index 665311660..046b58631 100755 --- a/src/extension/tab/tab.ts +++ b/src/extension/tab/tab.ts @@ -1,6 +1,6 @@ // This script is injected into each tab. import browser from "webextension-polyfill"; -import { ClientMessage } from "../messages"; +import type { ClientMessage } from "../messages"; import { createPortActor, createWindowActor } from "../actor"; import { createPortMessageAdapter, diff --git a/src/types.ts b/src/types.ts index bd73f3ad2..180b39a58 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { ApolloQueryResult } from "@apollo/client"; +import type { ApolloQueryResult } from "@apollo/client"; export type QueryResult = ApolloQueryResult;