Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: separate type imports in useSuspenseQuery.ts and useBackgroundQuery.ts #11134

Merged
merged 6 commits into from
Aug 28, 2023

Conversation

alessbell
Copy link
Member

Hopefully closes #11131 - opening a PR to test a snapshot release here.

Checklist:

  • If this PR contains changes to the library itself (not necessary for e.g. docs updates), please include a changeset (see CONTRIBUTING.md)
  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

@changeset-bot
Copy link

changeset-bot bot commented Aug 8, 2023

🦋 Changeset detected

Latest commit: 0bad299

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo/client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 37.16 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 43.62 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 42.25 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 32.39 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 31.21 KB (0%)
import { ApolloProvider } from "dist/react/index.js" 1.21 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production) 1.2 KB (0%)
import { useQuery } from "dist/react/index.js" 4.29 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.1 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 4.59 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.41 KB (0%)
import { useMutation } from "dist/react/index.js" 2.52 KB (0%)
import { useMutation } from "dist/react/index.js" (production) 2.5 KB (0%)
import { useSubscription } from "dist/react/index.js" 2.23 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 2.19 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 4.73 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.16 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 4.26 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.67 KB (0%)
import { useReadQuery } from "dist/react/index.js" 2.94 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 2.88 KB (0%)
import { useFragment } from "dist/react/index.js" 2.07 KB (0%)
import { useFragment } from "dist/react/index.js" (production) 2.02 KB (0%)

@alessbell
Copy link
Member Author

/release:pr

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

Please add a changeset via npx changeset before attempting a snapshot release.

@alessbell
Copy link
Member Author

/release:pr

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

A new release has been made for this PR. You can install it with npm i @apollo/client@0.0.0-pr-11134-20230808160421.

@diegohennrich
Copy link

I was facing the same issue:

  • NodeJS 18.x
  • Apollo 3.8.1

You must change the type also on the useReadQuery.ts file:

import type { QueryReference} from "../cache/QueryReference.js";

Could you do that and release a new one?

@alessbell
Copy link
Member Author

Wanted to also get @phryneas's take on this (welcome back! 😅), but this seems worth merging.

@alessbell alessbell marked this pull request as ready for review August 28, 2023 14:46
@alessbell
Copy link
Member Author

You must change the type also on the useReadQuery.ts file

Thanks, @diegohennrich - updated and cutting a new snapshot release now.

@alessbell
Copy link
Member Author

/release:pr

@github-actions
Copy link
Contributor

A new release has been made for this PR. You can install it with npm i @apollo/client@0.0.0-pr-11134-20230828144908.

@phryneas
Copy link
Member

phryneas commented Aug 28, 2023

@alessbell totally in favor of the change - there might be tooling other than tsc out there that is lagging behind, so backwards compat with something like this is always good.

Could you also adjust the lint rule accordingly as part of the PR?

See https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-imports.md#fixstyle

@jerelmiller jerelmiller mentioned this pull request Aug 28, 2023
3 tasks
Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating!

@alessbell
Copy link
Member Author

@phryneas yep, also my thinking there thanks for confirming 👍

Could you also adjust the lint rule accordingly as part of the PR?

Added import/consistent-type-specifier-style rule for this in 0bad299.

@alessbell alessbell merged commit 96492e1 into main Aug 28, 2023
20 checks passed
@alessbell alessbell deleted the separate-type-imports branch August 28, 2023 17:14
This was referenced Aug 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type error with apollo client package
4 participants