@octanejs/octane-is 0.0.1 → 0.0.3
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 +3 -3
- package/src/ReactIs.ts +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/octane-is",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Element-kind predicates for Octane, matching react-is 19.2.7's public surface.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"LICENSE.upstream"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"octane": "^0.
|
|
37
|
+
"octane": "^0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"react": "19.2.7",
|
|
41
41
|
"react-dom": "19.2.7",
|
|
42
42
|
"vitest": "^4.1.10",
|
|
43
|
-
"octane": "0.
|
|
43
|
+
"octane": "0.4.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"test": "vitest run --root ../.. --project octane-is --project octane-is-pristine --project octane-is-differential --maxWorkers=2",
|
package/src/ReactIs.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Activity, StrictMode as OctaneStrictMode } from 'octane';
|
|
7
7
|
import type { ElementDescriptor } from 'octane';
|
|
8
|
+
import { isContext } from 'octane/internal/context';
|
|
8
9
|
|
|
9
10
|
export const ContextConsumer: symbol = Symbol.for('octane.consumer');
|
|
10
11
|
export const ContextProvider: symbol = Symbol.for('octane.context');
|
|
@@ -25,7 +26,6 @@ interface BrandedValue {
|
|
|
25
26
|
}
|
|
26
27
|
interface ComponentMetadata extends Function {
|
|
27
28
|
$$kind?: unknown;
|
|
28
|
-
Provider?: unknown;
|
|
29
29
|
__memo?: unknown;
|
|
30
30
|
[key: symbol]: unknown;
|
|
31
31
|
}
|
|
@@ -42,8 +42,7 @@ export function typeOf(value: unknown): symbol | undefined {
|
|
|
42
42
|
if (typeof type === 'function') {
|
|
43
43
|
const component = type as ComponentMetadata;
|
|
44
44
|
if (component[Suspense] === true) return Suspense;
|
|
45
|
-
if (component
|
|
46
|
-
return ContextProvider;
|
|
45
|
+
if (isContext(component)) return ContextProvider;
|
|
47
46
|
// Lazy may acquire memo bailout metadata after resolving a memo wrapper.
|
|
48
47
|
// Its public kind remains Lazy, and inspecting it never starts the load.
|
|
49
48
|
if (component[Lazy] === true) return Lazy;
|