@octanejs/apollo-client 0.1.48 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/apollo-client",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -62,7 +62,7 @@
62
62
  "peerDependencies": {
63
63
  "@apollo/client": ">=4.2.6 <4.3.0",
64
64
  "graphql": "^16.0.0 || ^17.0.0",
65
- "octane": "^0.1.51 || ^0.2.0 || ^0.3.0",
65
+ "octane": "^0.4.0",
66
66
  "rxjs": "^7.3.0"
67
67
  },
68
68
  "devDependencies": {
@@ -74,7 +74,7 @@
74
74
  "react-dom": "19.2.7",
75
75
  "rxjs": "^7.8.2",
76
76
  "vitest": "^4.1.10",
77
- "octane": "0.3.0"
77
+ "octane": "0.4.3"
78
78
  },
79
79
  "scripts": {
80
80
  "test": "vitest run --root ../.. --project apollo-client"
@@ -1,4 +1,4 @@
1
- import * as React from 'octane';
1
+ import { createContext } from 'octane';
2
2
  import { invariant } from '@apollo/client/utilities/invariant';
3
3
  // To make sure Apollo Client doesn't create more than one React context
4
4
  // (which can lead to problems like having an Apollo Client instance added
@@ -6,11 +6,15 @@ import { invariant } from '@apollo/client/utilities/invariant';
6
6
  // context), a single Apollo context is created and tracked in global state.
7
7
  const contextKey = Symbol.for('__APOLLO_CONTEXT__');
8
8
  export function getApolloContext() {
9
- invariant('createContext' in React, 37);
10
- let context = React.createContext[contextKey];
9
+ // DEVIATION: upstream checks `'createContext' in React` on the namespace
10
+ // import. An `in` test forces bundlers to materialize the whole `octane`
11
+ // namespace object, retaining every public export; a named import keeps the
12
+ // same guard tree-shakeable.
13
+ invariant(typeof createContext === 'function', 37);
14
+ let context = createContext[contextKey];
11
15
  if (!context) {
12
- Object.defineProperty(React.createContext, contextKey, {
13
- value: (context = React.createContext({})),
16
+ Object.defineProperty(createContext, contextKey, {
17
+ value: (context = createContext({})),
14
18
  enumerable: false,
15
19
  writable: false,
16
20
  configurable: true,