-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add deprecation messages to moved exports. #301
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
export { | ||
registerApolloClient, | ||
type TransportedQueryRef, | ||
import { | ||
registerApolloClient as _registerApolloClient, | ||
type TransportedQueryRef as _TransportedQueryRef, | ||
} from "@apollo/experimental-nextjs-app-support"; | ||
|
||
/** | ||
* @deprecated | ||
* This import has moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { registerApolloClient } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const registerApolloClient = _registerApolloClient; | ||
|
||
/** | ||
* @deprecated | ||
* This import has moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import type { TransportedQueryRef } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export type TransportedQueryRef< | ||
TData = unknown, | ||
TVariables = unknown, | ||
> = _TransportedQueryRef<TData, TVariables>; |
151 changes: 136 additions & 15 deletions
151
packages/experimental-nextjs-app-support/src/ssr/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,138 @@ | ||
export { | ||
InMemoryCache as NextSSRInMemoryCache, | ||
ApolloClient as NextSSRApolloClient, | ||
SSRMultipartLink, | ||
DebounceMultipartResponsesLink, | ||
RemoveMultipartDirectivesLink, | ||
ApolloNextAppProvider, | ||
resetApolloClientSingletons as resetNextSSRApolloSingletons, | ||
type TransportedQueryRef, | ||
import { | ||
InMemoryCache, | ||
ApolloClient, | ||
resetApolloClientSingletons, | ||
SSRMultipartLink as _SSRMultipartLink, | ||
DebounceMultipartResponsesLink as _DebounceMultipartResponsesLink, | ||
RemoveMultipartDirectivesLink as _RemoveMultipartDirectivesLink, | ||
ApolloNextAppProvider as _ApolloNextAppProvider, | ||
type TransportedQueryRef as _TransportedQueryRef, | ||
} from "@apollo/experimental-nextjs-app-support"; | ||
export { | ||
useBackgroundQuery, | ||
useFragment, | ||
useQuery, | ||
useReadQuery, | ||
useSuspenseQuery, | ||
import { | ||
useBackgroundQuery as _useBackgroundQuery, | ||
useFragment as _useFragment, | ||
useQuery as _useQuery, | ||
useReadQuery as _useReadQuery, | ||
useSuspenseQuery as _useSuspenseQuery, | ||
} from "@apollo/client/index.js"; | ||
|
||
/** | ||
* @deprecated | ||
* This import has been renamed to `InMemoryCache` and moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { InMemoryCache } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const NextSSRInMemoryCache = InMemoryCache; | ||
/** | ||
* @deprecated | ||
* This import has been renamed to `ApolloClient` and moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { ApolloClient } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const NextSSRApolloClient = ApolloClient; | ||
/** | ||
* @deprecated | ||
* This import has been renamed to `resetApolloClientSingletons` and moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { resetApolloClientSingletons } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const resetNextSSRApolloSingletons = resetApolloClientSingletons; | ||
/** | ||
* @deprecated | ||
* This import has moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { SSRMultipartLink } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const SSRMultipartLink = _SSRMultipartLink; | ||
/** | ||
* @deprecated | ||
* This import has moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { DebounceMultipartResponsesLink } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const DebounceMultipartResponsesLink = _DebounceMultipartResponsesLink; | ||
/** | ||
* @deprecated | ||
* This import has moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { RemoveMultipartDirectivesLink } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const RemoveMultipartDirectivesLink = _RemoveMultipartDirectivesLink; | ||
/** | ||
* @deprecated | ||
* This import has moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import { ApolloNextAppProvider } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export const ApolloNextAppProvider = _ApolloNextAppProvider; | ||
/** | ||
* @deprecated | ||
* This import has moved to `"@apollo/experimental-nextjs-app-support"`. | ||
* Please update your import to | ||
* ```ts | ||
* import type { TransportedQueryRef } from "@apollo/experimental-nextjs-app-support"; | ||
* ``` | ||
*/ | ||
export type TransportedQueryRef< | ||
TData = unknown, | ||
TVariables = unknown, | ||
> = _TransportedQueryRef<TData, TVariables>; | ||
/** | ||
* @deprecated | ||
* Importing this hook from this package is not necessary anymore - you can directly import it from `@apollo/client`. | ||
* Please update your import to | ||
* ```ts | ||
* import { useBackgroundQuery } from "@apollo/client"; | ||
* ``` | ||
*/ | ||
export const useBackgroundQuery = _useBackgroundQuery; | ||
/** | ||
* @deprecated | ||
* Importing this hook from this package is not necessary anymore - you can directly import it from `@apollo/client`. | ||
* Please update your import to | ||
* ```ts | ||
* import { useFragment } from "@apollo/client"; | ||
* ``` | ||
*/ | ||
export const useFragment = _useFragment; | ||
/** | ||
* @deprecated | ||
* Importing this hook from this package is not necessary anymore - you can directly import it from `@apollo/client`. | ||
* Please update your import to | ||
* ```ts | ||
* import { useQuery } from "@apollo/client"; | ||
* ``` | ||
*/ | ||
export const useQuery = _useQuery; | ||
/** | ||
* @deprecated | ||
* Importing this hook from this package is not necessary anymore - you can directly import it from `@apollo/client`. | ||
* Please update your import to | ||
* ```ts | ||
* import { useReadQuery } from "@apollo/client"; | ||
* ``` | ||
*/ | ||
export const useReadQuery = _useReadQuery; | ||
/** | ||
* @deprecated | ||
* Importing this hook from this package is not necessary anymore - you can directly import it from `@apollo/client`. | ||
* Please update your import to | ||
* ```ts | ||
* import { useSuspenseQuery } from "@apollo/client"; | ||
* ``` | ||
*/ | ||
export const useSuspenseQuery = _useSuspenseQuery; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] I'd break this up into two sentences as I think it reads a bit better. Feel free to keep what you have though if you don't like this change, especially since this is just what you see in the editor. If you do like this, the other hook deprecations could also need this change to keep this consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!