@logixjs/react 0.1.0
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/README.md +64 -0
- package/dist/Hooks.cjs +2194 -0
- package/dist/Hooks.d.cts +77 -0
- package/dist/Hooks.d.ts +77 -0
- package/dist/Hooks.js +27 -0
- package/dist/ModuleRef-wZSQ3Wwo.d.cts +73 -0
- package/dist/ModuleRef-wZSQ3Wwo.d.ts +73 -0
- package/dist/ModuleScope.cjs +2695 -0
- package/dist/ModuleScope.d.cts +62 -0
- package/dist/ModuleScope.d.ts +62 -0
- package/dist/ModuleScope.js +9 -0
- package/dist/Platform.cjs +60 -0
- package/dist/Platform.d.cts +6 -0
- package/dist/Platform.d.ts +6 -0
- package/dist/Platform.js +6 -0
- package/dist/ReactPlatform.cjs +2813 -0
- package/dist/ReactPlatform.d.cts +40 -0
- package/dist/ReactPlatform.d.ts +40 -0
- package/dist/ReactPlatform.js +11 -0
- package/dist/RuntimeProvider.cjs +1618 -0
- package/dist/RuntimeProvider.d.cts +66 -0
- package/dist/RuntimeProvider.d.ts +66 -0
- package/dist/RuntimeProvider.js +8 -0
- package/dist/chunk-2WFULYPJ.js +856 -0
- package/dist/chunk-4G7H66OY.js +54 -0
- package/dist/chunk-G5MRIFKK.js +95 -0
- package/dist/chunk-JXAJTWSZ.js +773 -0
- package/dist/chunk-PYWHL7TA.js +351 -0
- package/dist/chunk-UFFCJGSZ.js +981 -0
- package/dist/chunk-VFWWMK67.js +0 -0
- package/dist/chunk-ZANGOPUQ.js +34 -0
- package/dist/global.d.cjs +1 -0
- package/dist/global.d.d.cts +9 -0
- package/dist/global.d.d.ts +9 -0
- package/dist/global.d.js +0 -0
- package/dist/index.cjs +3118 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +44 -0
- package/dist/useDispatch-BnzYVkRE.d.ts +81 -0
- package/dist/useDispatch-CnO5-66H.d.cts +81 -0
- package/package.json +58 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Layer, ManagedRuntime, Cause, Effect } from 'effect';
|
|
3
|
+
import * as Logix from '@logixjs/core';
|
|
4
|
+
|
|
5
|
+
type RuntimeProviderPolicyMode = 'sync' | 'suspend' | 'defer';
|
|
6
|
+
type YieldStrategy = 'none' | 'microtask' | 'macrotask';
|
|
7
|
+
interface YieldPolicy {
|
|
8
|
+
readonly strategy?: YieldStrategy;
|
|
9
|
+
/**
|
|
10
|
+
* Only enable yield when historical init cost exceeds this threshold.
|
|
11
|
+
*
|
|
12
|
+
* Note: the first run still forces yield (to ensure suspend mode enters pending ASAP).
|
|
13
|
+
* "First run" is memoized per runtime/session (more robust to remount/HMR).
|
|
14
|
+
*/
|
|
15
|
+
readonly onlyWhenOverBudgetMs?: number;
|
|
16
|
+
}
|
|
17
|
+
type ModuleHandle = Logix.ModuleImpl<string, Logix.AnyModuleShape, unknown> | Logix.ModuleTagType<string, Logix.AnyModuleShape>;
|
|
18
|
+
interface ModulePreloadPolicy {
|
|
19
|
+
readonly handles: ReadonlyArray<ModuleHandle>;
|
|
20
|
+
readonly concurrency?: number;
|
|
21
|
+
readonly yield?: YieldPolicy;
|
|
22
|
+
}
|
|
23
|
+
interface RuntimeProviderPolicy {
|
|
24
|
+
readonly mode?: RuntimeProviderPolicyMode;
|
|
25
|
+
readonly syncBudgetMs?: number;
|
|
26
|
+
readonly yield?: YieldPolicy;
|
|
27
|
+
/**
|
|
28
|
+
* Only effective when mode="defer": pre-initialize critical modules after Provider commit,
|
|
29
|
+
* avoiding cold start during the subtree's first render.
|
|
30
|
+
*
|
|
31
|
+
* - Shorthand: pass handles array directly.
|
|
32
|
+
* - Full form: pass { handles, concurrency, yield }.
|
|
33
|
+
*/
|
|
34
|
+
readonly preload?: ReadonlyArray<ModuleHandle> | ModulePreloadPolicy;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface RuntimeProviderProps {
|
|
38
|
+
readonly layer?: Layer.Layer<any, any, never>;
|
|
39
|
+
readonly runtime?: ManagedRuntime.ManagedRuntime<any, any>;
|
|
40
|
+
readonly children: React.ReactNode;
|
|
41
|
+
readonly fallback?: React.ReactNode;
|
|
42
|
+
readonly policy?: RuntimeProviderPolicy;
|
|
43
|
+
readonly onError?: (cause: Cause.Cause<unknown>, context: RuntimeProviderErrorContext) => Effect.Effect<void>;
|
|
44
|
+
}
|
|
45
|
+
type RuntimeProviderErrorContext = {
|
|
46
|
+
readonly source: 'provider';
|
|
47
|
+
readonly phase: 'provider.layer.build';
|
|
48
|
+
} | {
|
|
49
|
+
readonly source: 'provider';
|
|
50
|
+
readonly phase: 'debug.lifecycle_error';
|
|
51
|
+
readonly moduleId?: string;
|
|
52
|
+
readonly instanceId?: string;
|
|
53
|
+
readonly runtimeLabel?: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly source: 'provider';
|
|
56
|
+
readonly phase: 'debug.diagnostic_error';
|
|
57
|
+
readonly code: string;
|
|
58
|
+
readonly message: string;
|
|
59
|
+
readonly hint?: string;
|
|
60
|
+
readonly moduleId?: string;
|
|
61
|
+
readonly instanceId?: string;
|
|
62
|
+
readonly runtimeLabel?: string;
|
|
63
|
+
};
|
|
64
|
+
declare const RuntimeProvider: React.FC<RuntimeProviderProps>;
|
|
65
|
+
|
|
66
|
+
export { type ModuleHandle, type ModulePreloadPolicy, RuntimeProvider, type RuntimeProviderErrorContext, type RuntimeProviderPolicy, type RuntimeProviderPolicyMode, type RuntimeProviderProps, type YieldPolicy, type YieldStrategy };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Layer, ManagedRuntime, Cause, Effect } from 'effect';
|
|
3
|
+
import * as Logix from '@logixjs/core';
|
|
4
|
+
|
|
5
|
+
type RuntimeProviderPolicyMode = 'sync' | 'suspend' | 'defer';
|
|
6
|
+
type YieldStrategy = 'none' | 'microtask' | 'macrotask';
|
|
7
|
+
interface YieldPolicy {
|
|
8
|
+
readonly strategy?: YieldStrategy;
|
|
9
|
+
/**
|
|
10
|
+
* Only enable yield when historical init cost exceeds this threshold.
|
|
11
|
+
*
|
|
12
|
+
* Note: the first run still forces yield (to ensure suspend mode enters pending ASAP).
|
|
13
|
+
* "First run" is memoized per runtime/session (more robust to remount/HMR).
|
|
14
|
+
*/
|
|
15
|
+
readonly onlyWhenOverBudgetMs?: number;
|
|
16
|
+
}
|
|
17
|
+
type ModuleHandle = Logix.ModuleImpl<string, Logix.AnyModuleShape, unknown> | Logix.ModuleTagType<string, Logix.AnyModuleShape>;
|
|
18
|
+
interface ModulePreloadPolicy {
|
|
19
|
+
readonly handles: ReadonlyArray<ModuleHandle>;
|
|
20
|
+
readonly concurrency?: number;
|
|
21
|
+
readonly yield?: YieldPolicy;
|
|
22
|
+
}
|
|
23
|
+
interface RuntimeProviderPolicy {
|
|
24
|
+
readonly mode?: RuntimeProviderPolicyMode;
|
|
25
|
+
readonly syncBudgetMs?: number;
|
|
26
|
+
readonly yield?: YieldPolicy;
|
|
27
|
+
/**
|
|
28
|
+
* Only effective when mode="defer": pre-initialize critical modules after Provider commit,
|
|
29
|
+
* avoiding cold start during the subtree's first render.
|
|
30
|
+
*
|
|
31
|
+
* - Shorthand: pass handles array directly.
|
|
32
|
+
* - Full form: pass { handles, concurrency, yield }.
|
|
33
|
+
*/
|
|
34
|
+
readonly preload?: ReadonlyArray<ModuleHandle> | ModulePreloadPolicy;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface RuntimeProviderProps {
|
|
38
|
+
readonly layer?: Layer.Layer<any, any, never>;
|
|
39
|
+
readonly runtime?: ManagedRuntime.ManagedRuntime<any, any>;
|
|
40
|
+
readonly children: React.ReactNode;
|
|
41
|
+
readonly fallback?: React.ReactNode;
|
|
42
|
+
readonly policy?: RuntimeProviderPolicy;
|
|
43
|
+
readonly onError?: (cause: Cause.Cause<unknown>, context: RuntimeProviderErrorContext) => Effect.Effect<void>;
|
|
44
|
+
}
|
|
45
|
+
type RuntimeProviderErrorContext = {
|
|
46
|
+
readonly source: 'provider';
|
|
47
|
+
readonly phase: 'provider.layer.build';
|
|
48
|
+
} | {
|
|
49
|
+
readonly source: 'provider';
|
|
50
|
+
readonly phase: 'debug.lifecycle_error';
|
|
51
|
+
readonly moduleId?: string;
|
|
52
|
+
readonly instanceId?: string;
|
|
53
|
+
readonly runtimeLabel?: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly source: 'provider';
|
|
56
|
+
readonly phase: 'debug.diagnostic_error';
|
|
57
|
+
readonly code: string;
|
|
58
|
+
readonly message: string;
|
|
59
|
+
readonly hint?: string;
|
|
60
|
+
readonly moduleId?: string;
|
|
61
|
+
readonly instanceId?: string;
|
|
62
|
+
readonly runtimeLabel?: string;
|
|
63
|
+
};
|
|
64
|
+
declare const RuntimeProvider: React.FC<RuntimeProviderProps>;
|
|
65
|
+
|
|
66
|
+
export { type ModuleHandle, type ModulePreloadPolicy, RuntimeProvider, type RuntimeProviderErrorContext, type RuntimeProviderPolicy, type RuntimeProviderPolicyMode, type RuntimeProviderProps, type YieldPolicy, type YieldStrategy };
|