@logixjs/react 0.1.0 → 0.1.1
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/LICENSE +201 -0
- package/README.md +1 -1
- package/dist/Hooks.cjs +190 -256
- package/dist/Hooks.d.cts +6 -6
- package/dist/Hooks.d.ts +6 -6
- package/dist/Hooks.js +2 -2
- package/dist/{ModuleRef-wZSQ3Wwo.d.cts → ModuleRef-gZmL6Zvb.d.cts} +8 -3
- package/dist/{ModuleRef-wZSQ3Wwo.d.ts → ModuleRef-gZmL6Zvb.d.ts} +8 -3
- package/dist/ModuleScope.cjs +241 -294
- package/dist/ModuleScope.d.cts +4 -4
- package/dist/ModuleScope.d.ts +4 -4
- package/dist/ModuleScope.js +3 -3
- package/dist/ReactPlatform.cjs +200 -250
- package/dist/ReactPlatform.d.cts +2 -2
- package/dist/ReactPlatform.d.ts +2 -2
- package/dist/ReactPlatform.js +4 -4
- package/dist/RuntimeProvider.cjs +23 -7
- package/dist/RuntimeProvider.js +1 -1
- package/dist/{chunk-JXAJTWSZ.js → chunk-2M6MDNVT.js} +23 -7
- package/dist/{chunk-UFFCJGSZ.js → chunk-G2LX7WWQ.js} +161 -225
- package/dist/{chunk-4G7H66OY.js → chunk-JC3R6GII.js} +3 -3
- package/dist/{chunk-G5MRIFKK.js → chunk-STTE4SOJ.js} +3 -6
- package/dist/{chunk-PYWHL7TA.js → chunk-WOTNVLCD.js} +1 -1
- package/dist/index.cjs +231 -284
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/{useDispatch-BnzYVkRE.d.ts → useDispatch-CiDimIYZ.d.ts} +13 -15
- package/dist/{useDispatch-CnO5-66H.d.cts → useDispatch-DiwQQAfC.d.cts} +13 -15
- package/package.json +6 -3
package/dist/ReactPlatform.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RuntimeProviderProps } from './RuntimeProvider.cjs';
|
|
2
2
|
import { ManagedRuntime } from 'effect';
|
|
3
|
-
import { u as useModule, a as useLocalModule, b as useSelector, c as useDispatch } from './useDispatch-
|
|
3
|
+
import { u as useModule, a as useLocalModule, b as useSelector, c as useDispatch } from './useDispatch-DiwQQAfC.cjs';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import '@logixjs/core';
|
|
6
|
-
import './ModuleRef-
|
|
6
|
+
import './ModuleRef-gZmL6Zvb.cjs';
|
|
7
7
|
|
|
8
8
|
declare const ReactPlatform: {
|
|
9
9
|
/**
|
package/dist/ReactPlatform.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RuntimeProviderProps } from './RuntimeProvider.js';
|
|
2
2
|
import { ManagedRuntime } from 'effect';
|
|
3
|
-
import { u as useModule, a as useLocalModule, b as useSelector, c as useDispatch } from './useDispatch-
|
|
3
|
+
import { u as useModule, a as useLocalModule, b as useSelector, c as useDispatch } from './useDispatch-CiDimIYZ.js';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import '@logixjs/core';
|
|
6
|
-
import './ModuleRef-
|
|
6
|
+
import './ModuleRef-gZmL6Zvb.js';
|
|
7
7
|
|
|
8
8
|
declare const ReactPlatform: {
|
|
9
9
|
/**
|
package/dist/ReactPlatform.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReactPlatform
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JC3R6GII.js";
|
|
4
|
+
import "./chunk-WOTNVLCD.js";
|
|
5
|
+
import "./chunk-G2LX7WWQ.js";
|
|
6
6
|
import "./chunk-VFWWMK67.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-2M6MDNVT.js";
|
|
8
8
|
import "./chunk-2WFULYPJ.js";
|
|
9
9
|
export {
|
|
10
10
|
ReactPlatform
|
package/dist/RuntimeProvider.cjs
CHANGED
|
@@ -1248,6 +1248,20 @@ var RuntimeProvider = ({
|
|
|
1248
1248
|
);
|
|
1249
1249
|
const onErrorRef = import_react4.default.useRef(onError);
|
|
1250
1250
|
onErrorRef.current = onError;
|
|
1251
|
+
const hasTickServices = (0, import_react4.useMemo)(() => {
|
|
1252
|
+
try {
|
|
1253
|
+
Logix5.InternalContracts.getRuntimeStore(baseRuntime);
|
|
1254
|
+
return true;
|
|
1255
|
+
} catch {
|
|
1256
|
+
return false;
|
|
1257
|
+
}
|
|
1258
|
+
}, [baseRuntime]);
|
|
1259
|
+
const { binding: tickBinding } = useLayerBinding(
|
|
1260
|
+
baseRuntime,
|
|
1261
|
+
Logix5.InternalContracts.tickServicesLayer,
|
|
1262
|
+
!hasTickServices,
|
|
1263
|
+
onErrorRef.current
|
|
1264
|
+
);
|
|
1251
1265
|
const { binding: layerBinding } = useLayerBinding(baseRuntime, layer, Boolean(layer), onErrorRef.current);
|
|
1252
1266
|
const onErrorSink = (0, import_react4.useMemo)(() => {
|
|
1253
1267
|
if (!onError) return null;
|
|
@@ -1306,17 +1320,17 @@ var RuntimeProvider = ({
|
|
|
1306
1320
|
}
|
|
1307
1321
|
}, [baseRuntime, layerBinding, onErrorSink]);
|
|
1308
1322
|
const runtimeWithBindings = (0, import_react4.useMemo)(
|
|
1309
|
-
() => layerBinding || onErrorSink ? createRuntimeAdapter(
|
|
1323
|
+
() => tickBinding || layerBinding || onErrorSink ? createRuntimeAdapter(
|
|
1310
1324
|
baseRuntime,
|
|
1311
|
-
layerBinding ? [layerBinding.context] : [],
|
|
1312
|
-
layerBinding ? [layerBinding.scope] : [],
|
|
1313
|
-
layerBinding ? [layerBinding.loggers] : [],
|
|
1314
|
-
layerBinding ? [layerBinding.logLevel] : [],
|
|
1325
|
+
[...tickBinding ? [tickBinding.context] : [], ...layerBinding ? [layerBinding.context] : []],
|
|
1326
|
+
[...tickBinding ? [tickBinding.scope] : [], ...layerBinding ? [layerBinding.scope] : []],
|
|
1327
|
+
layerBinding ? [layerBinding.loggers] : tickBinding ? [tickBinding.loggers] : [],
|
|
1328
|
+
layerBinding ? [layerBinding.logLevel] : tickBinding ? [tickBinding.logLevel] : [],
|
|
1315
1329
|
[
|
|
1316
1330
|
onErrorSink ? [onErrorSink, ...inheritedDebugSinks] : layerBinding ? layerBinding.debugSinks : []
|
|
1317
1331
|
]
|
|
1318
1332
|
) : baseRuntime,
|
|
1319
|
-
[baseRuntime, inheritedDebugSinks, layerBinding, onErrorSink]
|
|
1333
|
+
[baseRuntime, inheritedDebugSinks, layerBinding, onErrorSink, tickBinding]
|
|
1320
1334
|
);
|
|
1321
1335
|
const didReportSyncConfigSnapshotRef = import_react4.default.useRef(false);
|
|
1322
1336
|
const [configState, setConfigState] = (0, import_react4.useState)(() => {
|
|
@@ -1421,6 +1435,7 @@ var RuntimeProvider = ({
|
|
|
1421
1435
|
}),
|
|
1422
1436
|
[runtimeWithBindings, configState, resolvedPolicy]
|
|
1423
1437
|
);
|
|
1438
|
+
const isTickServicesReady = hasTickServices || tickBinding !== null;
|
|
1424
1439
|
const isLayerReady = !layer || layerBinding !== null;
|
|
1425
1440
|
const isConfigReady = configState.loaded;
|
|
1426
1441
|
const resolveFallback = (phase) => {
|
|
@@ -1575,9 +1590,10 @@ var RuntimeProvider = ({
|
|
|
1575
1590
|
release();
|
|
1576
1591
|
};
|
|
1577
1592
|
}, [resolvedPolicy.mode, deferReady]);
|
|
1578
|
-
const isReady = isLayerReady && isConfigReady && (resolvedPolicy.mode !== "defer" || deferReady);
|
|
1593
|
+
const isReady = isTickServicesReady && isLayerReady && isConfigReady && (resolvedPolicy.mode !== "defer" || deferReady);
|
|
1579
1594
|
if (!isReady) {
|
|
1580
1595
|
const blockersList = [
|
|
1596
|
+
isTickServicesReady ? null : "tick",
|
|
1581
1597
|
isLayerReady ? null : "layer",
|
|
1582
1598
|
isConfigReady ? null : "config",
|
|
1583
1599
|
resolvedPolicy.mode !== "defer" || deferReady ? null : "preload"
|
package/dist/RuntimeProvider.js
CHANGED
|
@@ -403,6 +403,20 @@ var RuntimeProvider = ({
|
|
|
403
403
|
);
|
|
404
404
|
const onErrorRef = React2.useRef(onError);
|
|
405
405
|
onErrorRef.current = onError;
|
|
406
|
+
const hasTickServices = useMemo(() => {
|
|
407
|
+
try {
|
|
408
|
+
Logix2.InternalContracts.getRuntimeStore(baseRuntime);
|
|
409
|
+
return true;
|
|
410
|
+
} catch {
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
}, [baseRuntime]);
|
|
414
|
+
const { binding: tickBinding } = useLayerBinding(
|
|
415
|
+
baseRuntime,
|
|
416
|
+
Logix2.InternalContracts.tickServicesLayer,
|
|
417
|
+
!hasTickServices,
|
|
418
|
+
onErrorRef.current
|
|
419
|
+
);
|
|
406
420
|
const { binding: layerBinding } = useLayerBinding(baseRuntime, layer, Boolean(layer), onErrorRef.current);
|
|
407
421
|
const onErrorSink = useMemo(() => {
|
|
408
422
|
if (!onError) return null;
|
|
@@ -461,17 +475,17 @@ var RuntimeProvider = ({
|
|
|
461
475
|
}
|
|
462
476
|
}, [baseRuntime, layerBinding, onErrorSink]);
|
|
463
477
|
const runtimeWithBindings = useMemo(
|
|
464
|
-
() => layerBinding || onErrorSink ? createRuntimeAdapter(
|
|
478
|
+
() => tickBinding || layerBinding || onErrorSink ? createRuntimeAdapter(
|
|
465
479
|
baseRuntime,
|
|
466
|
-
layerBinding ? [layerBinding.context] : [],
|
|
467
|
-
layerBinding ? [layerBinding.scope] : [],
|
|
468
|
-
layerBinding ? [layerBinding.loggers] : [],
|
|
469
|
-
layerBinding ? [layerBinding.logLevel] : [],
|
|
480
|
+
[...tickBinding ? [tickBinding.context] : [], ...layerBinding ? [layerBinding.context] : []],
|
|
481
|
+
[...tickBinding ? [tickBinding.scope] : [], ...layerBinding ? [layerBinding.scope] : []],
|
|
482
|
+
layerBinding ? [layerBinding.loggers] : tickBinding ? [tickBinding.loggers] : [],
|
|
483
|
+
layerBinding ? [layerBinding.logLevel] : tickBinding ? [tickBinding.logLevel] : [],
|
|
470
484
|
[
|
|
471
485
|
onErrorSink ? [onErrorSink, ...inheritedDebugSinks] : layerBinding ? layerBinding.debugSinks : []
|
|
472
486
|
]
|
|
473
487
|
) : baseRuntime,
|
|
474
|
-
[baseRuntime, inheritedDebugSinks, layerBinding, onErrorSink]
|
|
488
|
+
[baseRuntime, inheritedDebugSinks, layerBinding, onErrorSink, tickBinding]
|
|
475
489
|
);
|
|
476
490
|
const didReportSyncConfigSnapshotRef = React2.useRef(false);
|
|
477
491
|
const [configState, setConfigState] = useState2(() => {
|
|
@@ -576,6 +590,7 @@ var RuntimeProvider = ({
|
|
|
576
590
|
}),
|
|
577
591
|
[runtimeWithBindings, configState, resolvedPolicy]
|
|
578
592
|
);
|
|
593
|
+
const isTickServicesReady = hasTickServices || tickBinding !== null;
|
|
579
594
|
const isLayerReady = !layer || layerBinding !== null;
|
|
580
595
|
const isConfigReady = configState.loaded;
|
|
581
596
|
const resolveFallback = (phase) => {
|
|
@@ -730,9 +745,10 @@ var RuntimeProvider = ({
|
|
|
730
745
|
release();
|
|
731
746
|
};
|
|
732
747
|
}, [resolvedPolicy.mode, deferReady]);
|
|
733
|
-
const isReady = isLayerReady && isConfigReady && (resolvedPolicy.mode !== "defer" || deferReady);
|
|
748
|
+
const isReady = isTickServicesReady && isLayerReady && isConfigReady && (resolvedPolicy.mode !== "defer" || deferReady);
|
|
734
749
|
if (!isReady) {
|
|
735
750
|
const blockersList = [
|
|
751
|
+
isTickServicesReady ? null : "tick",
|
|
736
752
|
isLayerReady ? null : "layer",
|
|
737
753
|
isConfigReady ? null : "config",
|
|
738
754
|
resolvedPolicy.mode !== "defer" || deferReady ? null : "preload"
|