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

0.10.0 (4) default connectToDevTools to false in RSC and SSR builds #271

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ describe(

const link = new MockSubscriptionLink();
const client = new ApolloClient({
connectToDevTools: false,
cache: new InMemoryCache(),
link,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ class ApolloClientBase<TCacheShape> extends OrigApolloClient<TCacheShape> {
static readonly info = bundle;

constructor(options: ApolloClientOptions<TCacheShape>) {
super(options);
super(
process.env.REACT_ENV === "rsc" || process.env.REACT_ENV === "ssr"
? {
connectToDevTools: false,
...options,
}
: options
);

if (!(this.cache instanceof InMemoryCache)) {
throw new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ test(
// @ts-expect-error we want to test exactly this
new upstreamPkg.ApolloClient({
cache: new upstreamPkg.InMemoryCache(),
connectToDevTools: false,
}),
children: null,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ function drain(stream: ReturnType<typeof renderToPipeableStream>) {
function makeClient() {
return new ApolloClient({
cache: new InMemoryCache(),
connectToDevTools: false,
});
}

Expand Down
Loading