react-state-basis 0.3.1 → 0.3.2
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/dist/chunk-I5ZFRXQP.mjs +18 -0
- package/dist/chunk-I5ZFRXQP.mjs.map +1 -0
- package/dist/index.d.mts +13 -97
- package/dist/index.d.ts +13 -97
- package/dist/index.js +146 -251
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +152 -217
- package/dist/index.mjs.map +1 -1
- package/dist/plugin.js +51 -29
- package/dist/production.d.mts +19 -16
- package/dist/production.d.ts +19 -16
- package/dist/production.js +25 -12
- package/dist/production.js.map +1 -1
- package/dist/production.mjs +20 -12
- package/dist/production.mjs.map +1 -1
- package/dist/vite-plugin.js +5 -15
- package/dist/vite-plugin.js.map +1 -1
- package/dist/vite-plugin.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-GEHMQPV4.mjs +0 -28
- package/dist/chunk-GEHMQPV4.mjs.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/vite-plugin.ts
|
|
2
|
+
function basis() {
|
|
3
|
+
return {
|
|
4
|
+
name: "vite-plugin-react-state-basis",
|
|
5
|
+
config() {
|
|
6
|
+
return {
|
|
7
|
+
optimizeDeps: {
|
|
8
|
+
exclude: ["react-state-basis"]
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
basis
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-I5ZFRXQP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vite-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nexport function basis(): Plugin {\n return {\n name: 'vite-plugin-react-state-basis',\n config() {\n return {\n optimizeDeps: {\n exclude: ['react-state-basis']\n }\n };\n }\n };\n}"],"mappings":";AACO,SAAS,QAAgB;AAC9B,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AACP,aAAO;AAAA,QACL,cAAc;AAAA,UACZ,SAAS,CAAC,mBAAmB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,67 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
export { React };
|
|
4
|
-
export { React as default };
|
|
5
|
-
export { AnchorHTMLAttributes, Attributes, ButtonHTMLAttributes, CSSProperties, ChangeEvent, ComponentProps, ComponentPropsWithRef, ComponentPropsWithoutRef, ComponentType, DependencyList, DetailedHTMLProps, Dispatch, DragEvent, EffectCallback, ElementType, FC, FocusEvent, FormEvent, HTMLAttributes, HTMLProps, InputHTMLAttributes, JSX, Key, KeyboardEvent, MouseEvent, MutableRefObject, PointerEvent, PropsWithChildren, ReactElement, ReactNode, ReactPortal, Reducer, Ref, RefObject, SVGProps, SetStateAction, TouchEvent } from 'react';
|
|
6
3
|
export { basis } from './vite-plugin.mjs';
|
|
7
4
|
import 'vite';
|
|
8
5
|
|
|
9
|
-
interface BasisEngineState {
|
|
10
|
-
config: {
|
|
11
|
-
debug: boolean;
|
|
12
|
-
};
|
|
13
|
-
history: Map<string, number[]>;
|
|
14
|
-
currentTickBatch: Set<string>;
|
|
15
|
-
redundantLabels: Set<string>;
|
|
16
|
-
booted: boolean;
|
|
17
|
-
updateLog: {
|
|
18
|
-
label: string;
|
|
19
|
-
ts: number;
|
|
20
|
-
}[];
|
|
21
|
-
tick: number;
|
|
22
|
-
isBatching: boolean;
|
|
23
|
-
currentEffectSource: string | null;
|
|
24
|
-
}
|
|
25
|
-
declare const config: {
|
|
26
|
-
debug: boolean;
|
|
27
|
-
};
|
|
28
|
-
declare const history: Map<string, number[]>;
|
|
29
|
-
declare const currentTickBatch: Set<string>;
|
|
30
|
-
declare const configureBasis: (newConfig: Partial<{
|
|
31
|
-
debug: boolean;
|
|
32
|
-
}>) => void;
|
|
33
|
-
declare const recordUpdate: (label: string) => boolean;
|
|
34
|
-
declare const beginEffectTracking: (label: string) => void;
|
|
35
|
-
declare const endEffectTracking: () => void;
|
|
36
|
-
declare const registerVariable: (label: string) => void;
|
|
37
|
-
declare const unregisterVariable: (label: string) => void;
|
|
38
|
-
declare const printBasisHealthReport: (threshold?: number) => void;
|
|
39
|
-
declare const __testEngine__: {
|
|
40
|
-
instance: BasisEngineState;
|
|
41
|
-
config: {
|
|
42
|
-
debug: boolean;
|
|
43
|
-
};
|
|
44
|
-
history: Map<string, number[]>;
|
|
45
|
-
currentTickBatch: Set<string>;
|
|
46
|
-
configureBasis: (newConfig: Partial<{
|
|
47
|
-
debug: boolean;
|
|
48
|
-
}>) => void;
|
|
49
|
-
registerVariable: (label: string) => void;
|
|
50
|
-
recordUpdate: (label: string) => boolean;
|
|
51
|
-
printBasisHealthReport: (threshold?: number) => void;
|
|
52
|
-
beginEffectTracking: (label: string) => void;
|
|
53
|
-
endEffectTracking: () => void;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
interface BasisProviderProps {
|
|
57
|
-
children: ReactNode;
|
|
58
|
-
debug?: boolean;
|
|
59
|
-
}
|
|
60
|
-
declare const BasisProvider: React__default.FC<BasisProviderProps>;
|
|
61
|
-
declare const useBasisConfig: () => {
|
|
62
|
-
debug: boolean;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
6
|
type GetReducerState<R extends React.Reducer<any, any>> = R extends React.Reducer<infer S, any> ? S : never;
|
|
66
7
|
type GetReducerAction<R extends React.Reducer<any, any>> = R extends React.Reducer<any, infer A> ? A : never;
|
|
67
8
|
declare function useState<S>(initialState: S | (() => S), label?: string): [S, React.Dispatch<React.SetStateAction<S>>];
|
|
@@ -75,8 +16,6 @@ declare function useEffect(effect: React.EffectCallback, deps?: React.Dependency
|
|
|
75
16
|
declare function useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList, label?: string): void;
|
|
76
17
|
declare function useTransition(_label?: string): [boolean, (callback: () => void) => void];
|
|
77
18
|
declare function useDeferredValue<T>(value: T, initialValueOrLabel?: T | string, label?: string): T;
|
|
78
|
-
declare function createContext<T>(defaultValue: T, label?: string): React.Context<T>;
|
|
79
|
-
declare const useContext: typeof React.useContext;
|
|
80
19
|
declare const useId: (label?: string) => string;
|
|
81
20
|
declare const useDebugValue: typeof React.useDebugValue;
|
|
82
21
|
declare const useImperativeHandle: typeof React.useImperativeHandle;
|
|
@@ -85,42 +24,19 @@ declare const useSyncExternalStore: any;
|
|
|
85
24
|
declare function use<T>(usable: React.Usable<T>): T;
|
|
86
25
|
declare function useOptimistic<S, P>(passthrough: S, reducer?: (state: S, payload: P) => S, label?: string): [S, (payload: P) => void];
|
|
87
26
|
declare function useActionState<State, Payload>(action: (state: State, payload: Payload) => Promise<State> | State, initialState: State, permalink?: string, label?: string): [state: State, dispatch: (payload: Payload) => void, isPending: boolean];
|
|
88
|
-
declare const __test__: {
|
|
89
|
-
registerVariable: (label: string) => void;
|
|
90
|
-
unregisterVariable: (label: string) => void;
|
|
91
|
-
recordUpdate: (label: string) => boolean;
|
|
92
|
-
beginEffectTracking: (label: string) => void;
|
|
93
|
-
endEffectTracking: () => void;
|
|
94
|
-
history: any;
|
|
95
|
-
currentTickBatch: any;
|
|
96
|
-
};
|
|
97
27
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
28
|
+
interface BasisProviderProps {
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
debug?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const BasisProvider: React__default.FC<BasisProviderProps>;
|
|
33
|
+
declare const useBasisConfig: () => {
|
|
34
|
+
debug: boolean;
|
|
104
35
|
};
|
|
105
|
-
declare const Component: typeof React.Component;
|
|
106
|
-
declare const Fragment: React.ExoticComponent<React.FragmentProps>;
|
|
107
|
-
declare const Profiler: React.ExoticComponent<React.ProfilerProps>;
|
|
108
|
-
declare const PureComponent: typeof React.PureComponent;
|
|
109
|
-
declare const StrictMode: React.ExoticComponent<{
|
|
110
|
-
children?: React.ReactNode | undefined;
|
|
111
|
-
}>;
|
|
112
|
-
declare const Suspense: React.ExoticComponent<React.SuspenseProps>;
|
|
113
|
-
declare const cloneElement: typeof React.cloneElement;
|
|
114
|
-
declare const createElement: typeof React.createElement;
|
|
115
|
-
declare const createRef: typeof React.createRef;
|
|
116
|
-
declare const forwardRef: typeof React.forwardRef;
|
|
117
|
-
declare const isValidElement: typeof React.isValidElement;
|
|
118
|
-
declare const lazy: typeof React.lazy;
|
|
119
|
-
declare const memo: typeof React.memo;
|
|
120
|
-
declare const startTransition: typeof React.startTransition;
|
|
121
|
-
declare const version: string;
|
|
122
|
-
declare const createPortal: any;
|
|
123
|
-
declare const flushSync: any;
|
|
124
|
-
declare const unstable_batchedUpdates: any;
|
|
125
36
|
|
|
126
|
-
|
|
37
|
+
declare const configureBasis: (newConfig: Partial<{
|
|
38
|
+
debug: boolean;
|
|
39
|
+
}>) => void;
|
|
40
|
+
declare const printBasisHealthReport: (threshold?: number) => void;
|
|
41
|
+
|
|
42
|
+
export { BasisProvider, configureBasis, printBasisHealthReport, use, useActionState, useBasisConfig, useCallback, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,67 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
export { React };
|
|
4
|
-
export { React as default };
|
|
5
|
-
export { AnchorHTMLAttributes, Attributes, ButtonHTMLAttributes, CSSProperties, ChangeEvent, ComponentProps, ComponentPropsWithRef, ComponentPropsWithoutRef, ComponentType, DependencyList, DetailedHTMLProps, Dispatch, DragEvent, EffectCallback, ElementType, FC, FocusEvent, FormEvent, HTMLAttributes, HTMLProps, InputHTMLAttributes, JSX, Key, KeyboardEvent, MouseEvent, MutableRefObject, PointerEvent, PropsWithChildren, ReactElement, ReactNode, ReactPortal, Reducer, Ref, RefObject, SVGProps, SetStateAction, TouchEvent } from 'react';
|
|
6
3
|
export { basis } from './vite-plugin.js';
|
|
7
4
|
import 'vite';
|
|
8
5
|
|
|
9
|
-
interface BasisEngineState {
|
|
10
|
-
config: {
|
|
11
|
-
debug: boolean;
|
|
12
|
-
};
|
|
13
|
-
history: Map<string, number[]>;
|
|
14
|
-
currentTickBatch: Set<string>;
|
|
15
|
-
redundantLabels: Set<string>;
|
|
16
|
-
booted: boolean;
|
|
17
|
-
updateLog: {
|
|
18
|
-
label: string;
|
|
19
|
-
ts: number;
|
|
20
|
-
}[];
|
|
21
|
-
tick: number;
|
|
22
|
-
isBatching: boolean;
|
|
23
|
-
currentEffectSource: string | null;
|
|
24
|
-
}
|
|
25
|
-
declare const config: {
|
|
26
|
-
debug: boolean;
|
|
27
|
-
};
|
|
28
|
-
declare const history: Map<string, number[]>;
|
|
29
|
-
declare const currentTickBatch: Set<string>;
|
|
30
|
-
declare const configureBasis: (newConfig: Partial<{
|
|
31
|
-
debug: boolean;
|
|
32
|
-
}>) => void;
|
|
33
|
-
declare const recordUpdate: (label: string) => boolean;
|
|
34
|
-
declare const beginEffectTracking: (label: string) => void;
|
|
35
|
-
declare const endEffectTracking: () => void;
|
|
36
|
-
declare const registerVariable: (label: string) => void;
|
|
37
|
-
declare const unregisterVariable: (label: string) => void;
|
|
38
|
-
declare const printBasisHealthReport: (threshold?: number) => void;
|
|
39
|
-
declare const __testEngine__: {
|
|
40
|
-
instance: BasisEngineState;
|
|
41
|
-
config: {
|
|
42
|
-
debug: boolean;
|
|
43
|
-
};
|
|
44
|
-
history: Map<string, number[]>;
|
|
45
|
-
currentTickBatch: Set<string>;
|
|
46
|
-
configureBasis: (newConfig: Partial<{
|
|
47
|
-
debug: boolean;
|
|
48
|
-
}>) => void;
|
|
49
|
-
registerVariable: (label: string) => void;
|
|
50
|
-
recordUpdate: (label: string) => boolean;
|
|
51
|
-
printBasisHealthReport: (threshold?: number) => void;
|
|
52
|
-
beginEffectTracking: (label: string) => void;
|
|
53
|
-
endEffectTracking: () => void;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
interface BasisProviderProps {
|
|
57
|
-
children: ReactNode;
|
|
58
|
-
debug?: boolean;
|
|
59
|
-
}
|
|
60
|
-
declare const BasisProvider: React__default.FC<BasisProviderProps>;
|
|
61
|
-
declare const useBasisConfig: () => {
|
|
62
|
-
debug: boolean;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
6
|
type GetReducerState<R extends React.Reducer<any, any>> = R extends React.Reducer<infer S, any> ? S : never;
|
|
66
7
|
type GetReducerAction<R extends React.Reducer<any, any>> = R extends React.Reducer<any, infer A> ? A : never;
|
|
67
8
|
declare function useState<S>(initialState: S | (() => S), label?: string): [S, React.Dispatch<React.SetStateAction<S>>];
|
|
@@ -75,8 +16,6 @@ declare function useEffect(effect: React.EffectCallback, deps?: React.Dependency
|
|
|
75
16
|
declare function useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList, label?: string): void;
|
|
76
17
|
declare function useTransition(_label?: string): [boolean, (callback: () => void) => void];
|
|
77
18
|
declare function useDeferredValue<T>(value: T, initialValueOrLabel?: T | string, label?: string): T;
|
|
78
|
-
declare function createContext<T>(defaultValue: T, label?: string): React.Context<T>;
|
|
79
|
-
declare const useContext: typeof React.useContext;
|
|
80
19
|
declare const useId: (label?: string) => string;
|
|
81
20
|
declare const useDebugValue: typeof React.useDebugValue;
|
|
82
21
|
declare const useImperativeHandle: typeof React.useImperativeHandle;
|
|
@@ -85,42 +24,19 @@ declare const useSyncExternalStore: any;
|
|
|
85
24
|
declare function use<T>(usable: React.Usable<T>): T;
|
|
86
25
|
declare function useOptimistic<S, P>(passthrough: S, reducer?: (state: S, payload: P) => S, label?: string): [S, (payload: P) => void];
|
|
87
26
|
declare function useActionState<State, Payload>(action: (state: State, payload: Payload) => Promise<State> | State, initialState: State, permalink?: string, label?: string): [state: State, dispatch: (payload: Payload) => void, isPending: boolean];
|
|
88
|
-
declare const __test__: {
|
|
89
|
-
registerVariable: (label: string) => void;
|
|
90
|
-
unregisterVariable: (label: string) => void;
|
|
91
|
-
recordUpdate: (label: string) => boolean;
|
|
92
|
-
beginEffectTracking: (label: string) => void;
|
|
93
|
-
endEffectTracking: () => void;
|
|
94
|
-
history: any;
|
|
95
|
-
currentTickBatch: any;
|
|
96
|
-
};
|
|
97
27
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
28
|
+
interface BasisProviderProps {
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
debug?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const BasisProvider: React__default.FC<BasisProviderProps>;
|
|
33
|
+
declare const useBasisConfig: () => {
|
|
34
|
+
debug: boolean;
|
|
104
35
|
};
|
|
105
|
-
declare const Component: typeof React.Component;
|
|
106
|
-
declare const Fragment: React.ExoticComponent<React.FragmentProps>;
|
|
107
|
-
declare const Profiler: React.ExoticComponent<React.ProfilerProps>;
|
|
108
|
-
declare const PureComponent: typeof React.PureComponent;
|
|
109
|
-
declare const StrictMode: React.ExoticComponent<{
|
|
110
|
-
children?: React.ReactNode | undefined;
|
|
111
|
-
}>;
|
|
112
|
-
declare const Suspense: React.ExoticComponent<React.SuspenseProps>;
|
|
113
|
-
declare const cloneElement: typeof React.cloneElement;
|
|
114
|
-
declare const createElement: typeof React.createElement;
|
|
115
|
-
declare const createRef: typeof React.createRef;
|
|
116
|
-
declare const forwardRef: typeof React.forwardRef;
|
|
117
|
-
declare const isValidElement: typeof React.isValidElement;
|
|
118
|
-
declare const lazy: typeof React.lazy;
|
|
119
|
-
declare const memo: typeof React.memo;
|
|
120
|
-
declare const startTransition: typeof React.startTransition;
|
|
121
|
-
declare const version: string;
|
|
122
|
-
declare const createPortal: any;
|
|
123
|
-
declare const flushSync: any;
|
|
124
|
-
declare const unstable_batchedUpdates: any;
|
|
125
36
|
|
|
126
|
-
|
|
37
|
+
declare const configureBasis: (newConfig: Partial<{
|
|
38
|
+
debug: boolean;
|
|
39
|
+
}>) => void;
|
|
40
|
+
declare const printBasisHealthReport: (threshold?: number) => void;
|
|
41
|
+
|
|
42
|
+
export { BasisProvider, configureBasis, printBasisHealthReport, use, useActionState, useBasisConfig, useCallback, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useReducer, useRef, useState, useSyncExternalStore, useTransition };
|