Skip to content

Commit

Permalink
0.10.0 (4) default connectToDevTools to false in RSC and SSR buil…
Browse files Browse the repository at this point in the history
…ds (#271)
  • Loading branch information
phryneas authored Apr 4, 2024
1 parent 100952e commit 622f4c5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
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
1 change: 0 additions & 1 deletion packages/client-react-streaming/src/importErrors.test.tsx
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

0 comments on commit 622f4c5

Please sign in to comment.