@buoy-gg/redux 7.0.5 → 7.0.6
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 +21 -2
- package/lib/commonjs/index.js +38 -0
- package/lib/commonjs/redux/components/ReduxAutoInstrument.js +20 -0
- package/lib/commonjs/redux/components/ReduxModal.js +11 -1
- package/lib/commonjs/redux/components/index.js +8 -1
- package/lib/commonjs/redux/hooks/useAutoInstrumentRedux.js +32 -42
- package/lib/commonjs/redux/sync/reduxSyncAdapter.js +27 -8
- package/lib/commonjs/redux/utils/activeStoreRegistry.js +73 -0
- package/lib/commonjs/redux/utils/autoInstrument.js +88 -114
- package/lib/commonjs/redux/utils/buoyReduxMiddleware.js +20 -15
- package/lib/commonjs/redux/utils/devtoolsHook.js +137 -0
- package/lib/commonjs/redux/utils/index.js +32 -1
- package/lib/module/index.js +26 -3
- package/lib/module/redux/components/ReduxAutoInstrument.js +17 -0
- package/lib/module/redux/components/ReduxModal.js +11 -1
- package/lib/module/redux/components/index.js +2 -1
- package/lib/module/redux/hooks/useAutoInstrumentRedux.js +33 -43
- package/lib/module/redux/sync/reduxSyncAdapter.js +28 -9
- package/lib/module/redux/utils/activeStoreRegistry.js +63 -0
- package/lib/module/redux/utils/autoInstrument.js +82 -113
- package/lib/module/redux/utils/buoyReduxMiddleware.js +20 -15
- package/lib/module/redux/utils/devtoolsHook.js +130 -0
- package/lib/module/redux/utils/index.js +3 -1
- package/lib/typescript/index.d.ts +18 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/redux/components/ReduxAutoInstrument.d.ts +11 -0
- package/lib/typescript/redux/components/ReduxAutoInstrument.d.ts.map +1 -0
- package/lib/typescript/redux/components/ReduxModal.d.ts.map +1 -1
- package/lib/typescript/redux/components/index.d.ts +1 -0
- package/lib/typescript/redux/components/index.d.ts.map +1 -1
- package/lib/typescript/redux/hooks/useAutoInstrumentRedux.d.ts +16 -28
- package/lib/typescript/redux/hooks/useAutoInstrumentRedux.d.ts.map +1 -1
- package/lib/typescript/redux/sync/reduxSyncAdapter.d.ts +18 -4
- package/lib/typescript/redux/sync/reduxSyncAdapter.d.ts.map +1 -1
- package/lib/typescript/redux/utils/activeStoreRegistry.d.ts +47 -0
- package/lib/typescript/redux/utils/activeStoreRegistry.d.ts.map +1 -0
- package/lib/typescript/redux/utils/autoInstrument.d.ts +46 -23
- package/lib/typescript/redux/utils/autoInstrument.d.ts.map +1 -1
- package/lib/typescript/redux/utils/buoyReduxMiddleware.d.ts +5 -1
- package/lib/typescript/redux/utils/buoyReduxMiddleware.d.ts.map +1 -1
- package/lib/typescript/redux/utils/devtoolsHook.d.ts +45 -0
- package/lib/typescript/redux/utils/devtoolsHook.d.ts.map +1 -0
- package/lib/typescript/redux/utils/index.d.ts +3 -2
- package/lib/typescript/redux/utils/index.d.ts.map +1 -1
- package/package.json +8 -5
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { reduxActionStore } from "./reduxActionStore";
|
|
20
|
+
import { registerActiveStore, getActiveStore } from "./activeStoreRegistry";
|
|
20
21
|
|
|
21
22
|
// ============================================
|
|
22
23
|
// Middleware Active Tracking
|
|
@@ -39,20 +40,22 @@ export function isMiddlewareActive() {
|
|
|
39
40
|
|
|
40
41
|
export const BUOY_JUMP_TO_STATE = "@@buoy/JUMP_TO_STATE";
|
|
41
42
|
export const BUOY_REPLAY_ACTION = "@@buoy/REPLAY_ACTION";
|
|
42
|
-
// Store reference to dispatch for time-travel
|
|
43
|
-
let storeDispatch = null;
|
|
44
|
-
|
|
45
43
|
/**
|
|
46
|
-
* Jump to a specific state (time-travel)
|
|
44
|
+
* Jump to a specific state (time-travel).
|
|
45
|
+
*
|
|
46
|
+
* Registry-backed, so it works on EVERY capture path (enhancer, middleware,
|
|
47
|
+
* patch) — previously this only worked when the middleware was installed,
|
|
48
|
+
* which silently broke the modal's Jump button on the zero-config path.
|
|
47
49
|
*/
|
|
48
50
|
export function jumpToState(state) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const store = getActiveStore();
|
|
52
|
+
if (store) {
|
|
53
|
+
store.dispatch({
|
|
51
54
|
type: BUOY_JUMP_TO_STATE,
|
|
52
55
|
payload: state
|
|
53
56
|
});
|
|
54
57
|
} else {
|
|
55
|
-
console.warn("[BuoyRedux] Cannot jump to state -
|
|
58
|
+
console.warn("[BuoyRedux] Cannot jump to state - no store instrumented");
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
|
|
@@ -60,11 +63,11 @@ export function jumpToState(state) {
|
|
|
60
63
|
* Replay an action (dispatch it again)
|
|
61
64
|
*/
|
|
62
65
|
export function replayAction(action) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
const store = getActiveStore();
|
|
67
|
+
if (store) {
|
|
68
|
+
store.dispatch(action);
|
|
66
69
|
} else {
|
|
67
|
-
console.warn("[BuoyRedux] Cannot replay action -
|
|
70
|
+
console.warn("[BuoyRedux] Cannot replay action - no store instrumented");
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -99,8 +102,10 @@ export const buoyReduxMiddleware = storeApi => {
|
|
|
99
102
|
// Mark middleware as active so auto-instrument knows to skip
|
|
100
103
|
middlewareActive = true;
|
|
101
104
|
|
|
102
|
-
//
|
|
103
|
-
|
|
105
|
+
// Register as the active store so getState/dispatch (MCP, desktop, time
|
|
106
|
+
// travel) work on the middleware path too — storeApi has both getState and
|
|
107
|
+
// dispatch, which is all the registry needs.
|
|
108
|
+
registerActiveStore(storeApi, "middleware");
|
|
104
109
|
return next => action => {
|
|
105
110
|
const actionObj = action;
|
|
106
111
|
const actionType = actionObj.type;
|
|
@@ -132,8 +137,8 @@ export function createBuoyReduxMiddleware(options = {}) {
|
|
|
132
137
|
// Mark middleware as active so auto-instrument knows to skip
|
|
133
138
|
middlewareActive = true;
|
|
134
139
|
|
|
135
|
-
//
|
|
136
|
-
|
|
140
|
+
// Register as the active store (see buoyReduxMiddleware above).
|
|
141
|
+
registerActiveStore(storeApi, "middleware");
|
|
137
142
|
return next => action => {
|
|
138
143
|
const actionObj = action;
|
|
139
144
|
const actionType = actionObj.type || "";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Store-creation-time capture via the OFFICIAL Redux DevTools hook.
|
|
5
|
+
*
|
|
6
|
+
* `configureStore` defaults `devTools: true` and, at RTK module-evaluation
|
|
7
|
+
* time, snapshots `window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__` if defined.
|
|
8
|
+
* That global doesn't exist in React Native — so Buoy claims it (dev builds
|
|
9
|
+
* only, and only when nothing else has). This makes Buoy a real store
|
|
10
|
+
* ENHANCER, present from the store's birth:
|
|
11
|
+
*
|
|
12
|
+
* - FULL capture: actions dispatched from inside middleware/thunks (RTK
|
|
13
|
+
* `pending`/`fulfilled`/`rejected`, RTK Query) hit our dispatch because the
|
|
14
|
+
* enhancer sits BELOW applyMiddleware in the compose chain.
|
|
15
|
+
* - Real time travel: we wrap the reducer, so BUOY_JUMP_TO_STATE actually
|
|
16
|
+
* jumps — and replaceReducer is re-wrapped, so hosts that inject reducers
|
|
17
|
+
* dynamically keep working.
|
|
18
|
+
* - Nothing is monkey-patched: this is the integration point Redux itself
|
|
19
|
+
* ships for devtools (same one react-native-debugger used).
|
|
20
|
+
*
|
|
21
|
+
* Race note: RTK snapshots the global when ITS module first evaluates, so this
|
|
22
|
+
* module must load before `@reduxjs/toolkit` does. `@buoy-gg/core` requires us
|
|
23
|
+
* at module scope, which usually wins; when it doesn't, the dispatch-patch
|
|
24
|
+
* fallback in autoInstrument.ts still binds at first mount. Apps that want a
|
|
25
|
+
* guarantee put `import '@buoy-gg/redux';` as the FIRST import of their entry.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { reduxActionStore } from "./reduxActionStore";
|
|
29
|
+
import { BUOY_JUMP_TO_STATE, isMiddlewareActive } from "./buoyReduxMiddleware";
|
|
30
|
+
import { registerActiveStore, ENHANCER_SYMBOL } from "./activeStoreRegistry";
|
|
31
|
+
/** Standard redux compose. */
|
|
32
|
+
function composeFns(...funcs) {
|
|
33
|
+
if (funcs.length === 0) return arg => arg;
|
|
34
|
+
if (funcs.length === 1) return funcs[0];
|
|
35
|
+
return funcs.reduce((a, b) => (...args) => a(b(...args)));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Wrap a reducer so BUOY_JUMP_TO_STATE performs a real state jump. */
|
|
39
|
+
function wrapReducer(reducer) {
|
|
40
|
+
return (state, action) => {
|
|
41
|
+
if (action && action.type === BUOY_JUMP_TO_STATE) {
|
|
42
|
+
return action.payload;
|
|
43
|
+
}
|
|
44
|
+
return reducer(state, action);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Should this action be recorded? (Mirrors autoInstrument's filters.) */
|
|
49
|
+
function isRecordable(action) {
|
|
50
|
+
if (typeof action !== "object" || action === null) return false;
|
|
51
|
+
const type = action.type;
|
|
52
|
+
if (typeof type !== "string") return false;
|
|
53
|
+
return !type.startsWith("@@buoy/") && !type.startsWith("@@redux/");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The Buoy store enhancer. Innermost in the compose chain (below
|
|
58
|
+
* applyMiddleware), so every action that reaches the reducer — including ones
|
|
59
|
+
* dispatched from inside middleware and thunks — passes through here.
|
|
60
|
+
*/
|
|
61
|
+
export const buoyDevtoolsEnhancer = createStore => (reducer, preloadedState) => {
|
|
62
|
+
const store = createStore(wrapReducer(reducer), preloadedState);
|
|
63
|
+
const dispatch = action => {
|
|
64
|
+
// If the explicit middleware is installed it already records — the
|
|
65
|
+
// enhancer stays passive to avoid double capture.
|
|
66
|
+
if (!isRecordable(action) || isMiddlewareActive()) {
|
|
67
|
+
return store.dispatch(action);
|
|
68
|
+
}
|
|
69
|
+
const startTime = performance.now();
|
|
70
|
+
const prevState = store.getState();
|
|
71
|
+
const result = store.dispatch(action);
|
|
72
|
+
reduxActionStore.addAction(action, prevState, store.getState(), performance.now() - startTime);
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
const enhanced = {
|
|
76
|
+
...store,
|
|
77
|
+
dispatch,
|
|
78
|
+
// Keep time travel alive across dynamic reducer injection.
|
|
79
|
+
replaceReducer: next => store.replaceReducer(wrapReducer(next)),
|
|
80
|
+
[ENHANCER_SYMBOL]: true
|
|
81
|
+
};
|
|
82
|
+
registerActiveStore(enhanced, "enhancer");
|
|
83
|
+
return enhanced;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Implements the `__REDUX_DEVTOOLS_EXTENSION_COMPOSE__` calling conventions:
|
|
88
|
+
* - `compose(options)(...enhancers)` — what RTK's configureStore does
|
|
89
|
+
* - `compose(...enhancers)` — classic createStore usage from the Redux docs
|
|
90
|
+
*/
|
|
91
|
+
function buoyComposeWithDevTools(...args) {
|
|
92
|
+
if (args.length === 0) {
|
|
93
|
+
return composeFns(buoyDevtoolsEnhancer);
|
|
94
|
+
}
|
|
95
|
+
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null) {
|
|
96
|
+
// Options form → return a compose function.
|
|
97
|
+
return (...enhancers) => composeFns(...enhancers, buoyDevtoolsEnhancer);
|
|
98
|
+
}
|
|
99
|
+
return composeFns(...args, buoyDevtoolsEnhancer);
|
|
100
|
+
}
|
|
101
|
+
let claimed = false;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Claim the DevTools globals — dev builds only, and never over an existing
|
|
105
|
+
* claimant (e.g. the real browser extension on web).
|
|
106
|
+
*
|
|
107
|
+
* Idempotent; runs at module scope so simply importing `@buoy-gg/redux` (which
|
|
108
|
+
* `@buoy-gg/core` does at module scope) performs the claim as early as
|
|
109
|
+
* possible.
|
|
110
|
+
*/
|
|
111
|
+
export function claimDevtoolsHook() {
|
|
112
|
+
const isDev = typeof __DEV__ !== "undefined" && __DEV__;
|
|
113
|
+
if (!isDev) return false;
|
|
114
|
+
const g = globalThis;
|
|
115
|
+
if (!g.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) {
|
|
116
|
+
g.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = buoyComposeWithDevTools;
|
|
117
|
+
claimed = true;
|
|
118
|
+
}
|
|
119
|
+
if (!g.__REDUX_DEVTOOLS_EXTENSION__) {
|
|
120
|
+
// Legacy single-enhancer form: `createStore(reducer, __REDUX_DEVTOOLS_EXTENSION__())`
|
|
121
|
+
g.__REDUX_DEVTOOLS_EXTENSION__ = () => buoyDevtoolsEnhancer;
|
|
122
|
+
}
|
|
123
|
+
return claimed;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Whether Buoy owns the DevTools compose global (i.e. won the load race). */
|
|
127
|
+
export function isDevtoolsHookClaimed() {
|
|
128
|
+
return claimed;
|
|
129
|
+
}
|
|
130
|
+
claimDevtoolsHook();
|
|
@@ -5,4 +5,6 @@ export { buoyReduxMiddleware, createBuoyReduxMiddleware, withBuoyDevTools, jumpT
|
|
|
5
5
|
export { createReduxHistoryAdapter, reduxHistoryAdapter } from "./createReduxHistoryAdapter";
|
|
6
6
|
|
|
7
7
|
// Auto-instrumentation (zero-config)
|
|
8
|
-
export { instrumentStore, uninstrumentStore, isStoreInstrumented, isAutoInstrumentActive, getActiveStore, jumpToState as autoJumpToState, replayAction as autoReplayAction } from "./autoInstrument";
|
|
8
|
+
export { instrumentStore, uninstrumentStore, isStoreInstrumented, isAutoInstrumentActive, getActiveStore, getInstrumentationStatus, registerReduxStore, jumpToState as autoJumpToState, replayAction as autoReplayAction } from "./autoInstrument";
|
|
9
|
+
// Store-creation-time capture (the primary, full-capture path)
|
|
10
|
+
export { buoyDevtoolsEnhancer, claimDevtoolsHook, isDevtoolsHookClaimed } from "./devtoolsHook";
|
|
@@ -27,9 +27,20 @@
|
|
|
27
27
|
*
|
|
28
28
|
* That's it! The Redux tool will auto-detect your store and capture actions.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
30
|
+
* HOW CAPTURE WORKS (in priority order):
|
|
31
|
+
* 1. ENHANCER — importing this package claims the official Redux DevTools
|
|
32
|
+
* global (`__REDUX_DEVTOOLS_EXTENSION_COMPOSE__`), which RTK checks by
|
|
33
|
+
* default. If this package loads before your store module, Buoy is inside
|
|
34
|
+
* the store from creation: FULL capture (thunk/RTK Query actions included)
|
|
35
|
+
* and real time travel. To guarantee this ordering, make
|
|
36
|
+
* `import '@buoy-gg/redux';` the FIRST import of your app entry.
|
|
37
|
+
* 2. MIDDLEWARE — add `buoyReduxMiddleware` for explicit full capture.
|
|
38
|
+
* 3. PATCH — otherwise, `FloatingDevTools` binds the store at first mount by
|
|
39
|
+
* patching store.dispatch. Top-level dispatches only (thunk-internal
|
|
40
|
+
* actions bypass a dispatch patch — that's a Redux architecture fact).
|
|
41
|
+
*
|
|
42
|
+
* @example Advanced: Manual middleware (explicit full capture)
|
|
31
43
|
* ```tsx
|
|
32
|
-
* // For time-travel or custom options, you can optionally use middleware:
|
|
33
44
|
* import { buoyReduxMiddleware, withBuoyDevTools } from '@buoy-gg/redux';
|
|
34
45
|
*
|
|
35
46
|
* const store = configureStore({
|
|
@@ -39,10 +50,12 @@
|
|
|
39
50
|
* });
|
|
40
51
|
* ```
|
|
41
52
|
*/
|
|
53
|
+
import "./redux/utils/devtoolsHook";
|
|
42
54
|
export { reduxToolPreset, createReduxTool } from "./preset";
|
|
43
55
|
export { buoyReduxMiddleware, createBuoyReduxMiddleware, withBuoyDevTools, jumpToState, replayAction, BUOY_JUMP_TO_STATE, BUOY_REPLAY_ACTION, } from "./redux/utils/buoyReduxMiddleware";
|
|
44
|
-
export { instrumentStore, uninstrumentStore, isStoreInstrumented, isAutoInstrumentActive, getActiveStore, } from "./redux/utils/autoInstrument";
|
|
45
|
-
export type { AutoInstrumentOptions } from "./redux/utils/autoInstrument";
|
|
56
|
+
export { instrumentStore, uninstrumentStore, isStoreInstrumented, isAutoInstrumentActive, getActiveStore, getInstrumentationStatus, registerReduxStore, } from "./redux/utils/autoInstrument";
|
|
57
|
+
export type { AutoInstrumentOptions, InstrumentationStatus, CaptureMechanism, } from "./redux/utils/autoInstrument";
|
|
58
|
+
export { buoyDevtoolsEnhancer, claimDevtoolsHook, isDevtoolsHookClaimed, } from "./redux/utils/devtoolsHook";
|
|
46
59
|
export { createReduxHistoryAdapter, reduxHistoryAdapter, type ReduxHistoryAdapterOptions, } from "./redux/utils/createReduxHistoryAdapter";
|
|
47
60
|
export { reduxSyncAdapter } from "./redux/sync/reduxSyncAdapter";
|
|
48
61
|
export { useReduxActions } from "./redux/hooks/useReduxActions";
|
|
@@ -54,6 +67,7 @@ export { ReduxActionItem } from "./redux/components/ReduxActionItem";
|
|
|
54
67
|
export { ReduxActionDetailView } from "./redux/components/ReduxActionDetailView";
|
|
55
68
|
export { ReduxActionDetailContent, ReduxActionDetailFooter, } from "./redux/components/ReduxActionDetailContent";
|
|
56
69
|
export { ReduxIcon } from "./redux/components/ReduxIcon";
|
|
70
|
+
export { ReduxAutoInstrument } from "./redux/components/ReduxAutoInstrument";
|
|
57
71
|
export type { ActionCategory, ActionMeta, ReduxAction, ReduxFilter, ReduxConnectorOptions, ReduxStoreMinimal, BuoyReduxMiddlewareOptions, } from "./redux/types";
|
|
58
72
|
/** @internal */
|
|
59
73
|
export { reduxActionStore } from "./redux/utils/reduxActionStore";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAKH,OAAO,4BAA4B,CAAC;AAKpC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAK5D,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,MAAM,yCAAyC,CAAC;AAKjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,sCAAsC,CAAC;AAO9C,OAAO,EACL,UAAU,EACV,aAAa,EACb,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAK7E,YAAY,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAKvB,gBAAgB;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless startup instrumentation. Auto-rendered by FloatingDevTools (same
|
|
3
|
+
* pattern as RouteTracker & the overlay tools) so the Redux store is bound
|
|
4
|
+
* from app mount — action log, MCP getState/dispatch, and desktop sync all
|
|
5
|
+
* work WITHOUT the user ever opening the Redux tool. Renders nothing.
|
|
6
|
+
*
|
|
7
|
+
* Safe anywhere: if react-redux is missing or there's no Provider above, the
|
|
8
|
+
* hook records the diagnostic and fails gracefully.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ReduxAutoInstrument(): null;
|
|
11
|
+
//# sourceMappingURL=ReduxAutoInstrument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReduxAutoInstrument.d.ts","sourceRoot":"","sources":["../../../../src/redux/components/ReduxAutoInstrument.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReduxModal.d.ts","sourceRoot":"","sources":["../../../../src/redux/components/ReduxModal.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2CH,yCAAyC;AACzC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,UAAU,eAAe;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAgBD,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,MAAc,GACf,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"ReduxModal.d.ts","sourceRoot":"","sources":["../../../../src/redux/components/ReduxModal.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2CH,yCAAyC;AACzC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,UAAU,eAAe;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAgBD,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,MAAc,GACf,EAAE,eAAe,sCAwajB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,GAAE,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAGpE"}
|
|
@@ -3,4 +3,5 @@ export { ReduxActionItem } from "./ReduxActionItem";
|
|
|
3
3
|
export { ReduxActionDetailView } from "./ReduxActionDetailView";
|
|
4
4
|
export { ReduxActionDetailContent, ReduxActionDetailFooter, } from "./ReduxActionDetailContent";
|
|
5
5
|
export { ReduxIcon } from "./ReduxIcon";
|
|
6
|
+
export { ReduxAutoInstrument } from "./ReduxAutoInstrument";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/redux/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/redux/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React hook for auto-instrumenting Redux stores
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Mounted for the app's lifetime by FloatingDevTools (via ReduxAutoInstrument)
|
|
5
|
+
* and also called by the Redux modal. Binds Buoy to the store from react-redux
|
|
6
|
+
* context:
|
|
7
|
+
* - If the store was created through the devtools-hook enhancer, capture is
|
|
8
|
+
* already live — this just keeps the registry pointed at it.
|
|
9
|
+
* - Otherwise it applies the dispatch-patch fallback (top-level-only capture).
|
|
10
|
+
* - If react-redux is missing or there's no Provider above, it fails
|
|
11
|
+
* gracefully and records WHY (surfaced by the sync adapter / MCP).
|
|
6
12
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - If successful, it instruments the store automatically
|
|
10
|
-
* - If react-redux is not available or not in a Provider, it fails gracefully
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* function ReduxDevTools() {
|
|
15
|
-
* const { isInstrumented, error } = useAutoInstrumentRedux();
|
|
16
|
-
*
|
|
17
|
-
* if (error) {
|
|
18
|
-
* return <Text>Redux not available: {error}</Text>;
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* return <ReduxActionList />;
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
13
|
+
* Re-instruments when the store INSTANCE changes (hosts that rebuild their
|
|
14
|
+
* store at runtime), so the registry never pins a dead store.
|
|
24
15
|
*/
|
|
25
16
|
import type { Store } from "@reduxjs/toolkit";
|
|
26
|
-
import { type AutoInstrumentOptions } from "../utils/autoInstrument";
|
|
17
|
+
import { type AutoInstrumentOptions, type CaptureMechanism } from "../utils/autoInstrument";
|
|
27
18
|
export interface UseAutoInstrumentReduxOptions extends AutoInstrumentOptions {
|
|
28
19
|
/** Whether to auto-start instrumentation (default: true) */
|
|
29
20
|
autoStart?: boolean;
|
|
@@ -37,6 +28,11 @@ export interface UseAutoInstrumentReduxResult {
|
|
|
37
28
|
error: string | null;
|
|
38
29
|
/** Whether react-redux is available */
|
|
39
30
|
isReactReduxAvailable: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Which capture path is live: 'enhancer' | 'middleware' (full capture) or
|
|
33
|
+
* 'patch' (top-level-only), null when nothing is bound yet.
|
|
34
|
+
*/
|
|
35
|
+
captureMechanism: CaptureMechanism | null;
|
|
40
36
|
/** Manually start instrumentation */
|
|
41
37
|
startInstrumentation: () => void;
|
|
42
38
|
/** Manually stop instrumentation */
|
|
@@ -44,14 +40,6 @@ export interface UseAutoInstrumentReduxResult {
|
|
|
44
40
|
/** Reference to the instrumented store */
|
|
45
41
|
store: Store | null;
|
|
46
42
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Hook to automatically instrument Redux store for DevTools
|
|
49
|
-
*
|
|
50
|
-
* This provides zero-config Redux action capture by:
|
|
51
|
-
* 1. Using react-redux's useStore() to get the Redux store
|
|
52
|
-
* 2. Automatically patching store.dispatch to capture actions
|
|
53
|
-
* 3. Cleaning up when the component unmounts
|
|
54
|
-
*/
|
|
55
43
|
export declare function useAutoInstrumentRedux(options?: UseAutoInstrumentReduxOptions): UseAutoInstrumentReduxResult;
|
|
56
44
|
/**
|
|
57
45
|
* Lightweight hook to just check if Redux is available
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoInstrumentRedux.d.ts","sourceRoot":"","sources":["../../../../src/redux/hooks/useAutoInstrumentRedux.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useAutoInstrumentRedux.d.ts","sourceRoot":"","sources":["../../../../src/redux/hooks/useAutoInstrumentRedux.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AA0BjC,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B;IAC3C,kDAAkD;IAClD,cAAc,EAAE,OAAO,CAAC;IACxB,6CAA6C;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uCAAuC;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,oCAAoC;IACpC,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,0CAA0C;IAC1C,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAMD,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,6BAAkC,GAC1C,4BAA4B,CAkH9B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CA0BA"}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* `useExternalSync` (structurally matches its ToolSyncAdapter interface so
|
|
4
4
|
* this package doesn't need a dependency on it).
|
|
5
5
|
*
|
|
6
|
-
* Actions are captured by the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Actions are captured from app startup — by the store-creation enhancer or
|
|
7
|
+
* the explicit middleware (full capture), or by the dispatch-patch fallback
|
|
8
|
+
* mounted with FloatingDevTools (top-level-only) — independent of whether a
|
|
9
|
+
* dashboard is watching. Subscribing here only streams what's already
|
|
10
|
+
* recorded.
|
|
9
11
|
*
|
|
10
12
|
* `getState`/`dispatch` read & drive the live instrumented store (via
|
|
11
13
|
* getActiveStore()) so a remote driver (MCP/LLM) can inspect current state and
|
|
@@ -23,12 +25,24 @@ export declare const reduxSyncAdapter: {
|
|
|
23
25
|
* the full state tree only when `includeValues` is set (heavy).
|
|
24
26
|
*/
|
|
25
27
|
getState: (params: unknown) => {
|
|
26
|
-
|
|
28
|
+
available: false;
|
|
29
|
+
slices: string[];
|
|
30
|
+
/** 'no-react-redux' | 'no-provider' | 'not-instrumented' */
|
|
31
|
+
reason: string;
|
|
32
|
+
} | {
|
|
33
|
+
state?: unknown;
|
|
27
34
|
available: boolean;
|
|
28
35
|
slices: string[];
|
|
36
|
+
/** 'full' | 'top-level-only' — what the live capture mechanism sees. */
|
|
37
|
+
capture: "full" | "top-level-only" | "none";
|
|
38
|
+
mechanism: import("..").CaptureMechanism | null;
|
|
29
39
|
};
|
|
30
40
|
/** Dispatch a plain action object to the instrumented store. */
|
|
31
41
|
dispatch: (params: unknown) => {
|
|
42
|
+
available: false;
|
|
43
|
+
slices: string[];
|
|
44
|
+
/** 'no-react-redux' | 'no-provider' | 'not-instrumented' */
|
|
45
|
+
reason: string;
|
|
32
46
|
dispatched: boolean;
|
|
33
47
|
type?: undefined;
|
|
34
48
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduxSyncAdapter.d.ts","sourceRoot":"","sources":["../../../../src/redux/sync/reduxSyncAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reduxSyncAdapter.d.ts","sourceRoot":"","sources":["../../../../src/redux/sync/reduxSyncAdapter.ts"],"names":[],"mappings":"AAsCA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB;;;0BAGL,MAAM,IAAI;;;QAK9B;;;WAGG;2BACgB,OAAO;;oBAlCZ,MAAM,EAAE;YACtB,4DAA4D;;;;;;YA6CxD,wEAAwE;;;;QAM5E,gEAAgE;2BAC7C,OAAO;;oBArDZ,MAAM,EAAE;YACtB,4DAA4D;;;;;;;;;CA8D/D,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared registry for the one live Redux store Buoy is bound to, plus how it
|
|
3
|
+
* got bound (the capture mechanism) and why binding failed when it did.
|
|
4
|
+
*
|
|
5
|
+
* Lives in its own module so the three capture paths (devtools-hook enhancer,
|
|
6
|
+
* explicit middleware, dispatch-patch fallback) and the sync adapter can all
|
|
7
|
+
* import it without cycles.
|
|
8
|
+
*/
|
|
9
|
+
/** The minimum store surface Buoy needs (middleware storeApi satisfies this). */
|
|
10
|
+
export interface ActiveReduxStore {
|
|
11
|
+
getState: () => unknown;
|
|
12
|
+
dispatch: (action: any) => unknown;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* How the store got instrumented:
|
|
16
|
+
* - `enhancer` — store-creation-time enhancer via the Redux DevTools global.
|
|
17
|
+
* FULL capture (thunk-internal & RTK Query actions included).
|
|
18
|
+
* - `middleware` — user-added buoyReduxMiddleware. FULL capture.
|
|
19
|
+
* - `patch` — store.dispatch patched after creation (auto-instrumentation
|
|
20
|
+
* fallback). TOP-LEVEL-ONLY capture: actions dispatched from
|
|
21
|
+
* inside middleware/thunks bypass the patch.
|
|
22
|
+
*/
|
|
23
|
+
export type CaptureMechanism = "enhancer" | "middleware" | "patch";
|
|
24
|
+
/** Why there is no bound store, when there isn't one. */
|
|
25
|
+
export type ReduxDiagnostic = "no-react-redux" | "no-provider" | null;
|
|
26
|
+
/** Marks stores created through the Buoy devtools-hook enhancer. */
|
|
27
|
+
export declare const ENHANCER_SYMBOL: unique symbol;
|
|
28
|
+
export declare function registerActiveStore(store: ActiveReduxStore, mech: CaptureMechanism): void;
|
|
29
|
+
export declare function unregisterActiveStore(store: ActiveReduxStore): void;
|
|
30
|
+
export declare function getActiveStore(): ActiveReduxStore | null;
|
|
31
|
+
export declare function getCaptureMechanism(): CaptureMechanism | null;
|
|
32
|
+
/**
|
|
33
|
+
* Recorded by the auto-instrument hook so non-React surfaces (sync adapter,
|
|
34
|
+
* MCP) can report WHY there's no store instead of a generic failure.
|
|
35
|
+
*/
|
|
36
|
+
export declare function setReduxDiagnostic(d: ReduxDiagnostic): void;
|
|
37
|
+
export interface InstrumentationStatus {
|
|
38
|
+
/** Which capture path bound the store, or null when none has. */
|
|
39
|
+
mechanism: CaptureMechanism | null;
|
|
40
|
+
/** What the bound mechanism can see. */
|
|
41
|
+
capture: "full" | "top-level-only" | "none";
|
|
42
|
+
hasStore: boolean;
|
|
43
|
+
/** Why there's no store, when known (from the auto-instrument hook). */
|
|
44
|
+
diagnostic: ReduxDiagnostic;
|
|
45
|
+
}
|
|
46
|
+
export declare function getInstrumentationStatus(): InstrumentationStatus;
|
|
47
|
+
//# sourceMappingURL=activeStoreRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activeStoreRegistry.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/activeStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,OAAO,CAAC;IAIxB,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,CAAC;AAEnE,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,aAAa,GAAG,IAAI,CAAC;AAEtE,oEAAoE;AACpE,eAAO,MAAM,eAAe,eAA4C,CAAC;AAMzE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE,gBAAgB,GACrB,IAAI,CAIN;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAKnE;AAED,wBAAgB,cAAc,IAAI,gBAAgB,GAAG,IAAI,CAExD;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAE7D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI,CAE3D;AAED,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnC,wCAAwC;IACxC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,MAAM,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,wBAAgB,wBAAwB,IAAI,qBAAqB,CAYhE"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Fallback auto-instrumentation for Redux stores.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The PRIMARY capture path is the store-creation-time enhancer in
|
|
5
|
+
* devtoolsHook.ts (full capture, real time travel). This module is the
|
|
6
|
+
* fallback for stores created before our module loaded: it patches
|
|
7
|
+
* store.dispatch after the fact.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* middleware
|
|
9
|
+
* Fallback limitation (inherent to patching, verified against redux 5.x):
|
|
10
|
+
* `middlewareAPI.dispatch` is a separate closure from `store.dispatch`, so
|
|
11
|
+
* actions dispatched from INSIDE middleware/thunks (RTK pending/fulfilled/
|
|
12
|
+
* rejected, RTK Query) bypass the patch. That's why this mechanism reports
|
|
13
|
+
* capture as "top-level-only" — see activeStoreRegistry.getInstrumentationStatus.
|
|
10
14
|
*/
|
|
11
15
|
import type { Store, UnknownAction } from "@reduxjs/toolkit";
|
|
16
|
+
import { type ActiveReduxStore } from "./activeStoreRegistry";
|
|
17
|
+
export { getInstrumentationStatus, type InstrumentationStatus, type CaptureMechanism, } from "./activeStoreRegistry";
|
|
12
18
|
export interface AutoInstrumentOptions {
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated No longer does anything. Time travel is real on the enhancer
|
|
21
|
+
* path (zero-config) and via `withBuoyDevTools` on the middleware path; the
|
|
22
|
+
* old patch-path implementation could corrupt host stores and was removed.
|
|
23
|
+
*/
|
|
14
24
|
enableTimeTravel?: boolean;
|
|
15
25
|
/** Maximum number of actions to store */
|
|
16
26
|
maxActions?: number;
|
|
@@ -18,29 +28,42 @@ export interface AutoInstrumentOptions {
|
|
|
18
28
|
ignoreActions?: string[];
|
|
19
29
|
}
|
|
20
30
|
/**
|
|
21
|
-
* Check if a store has already been instrumented
|
|
31
|
+
* Check if a store has already been instrumented (either mechanism)
|
|
22
32
|
*/
|
|
23
33
|
export declare function isStoreInstrumented(store: Store): boolean;
|
|
24
34
|
/**
|
|
25
|
-
* Instrument a Redux store for action capture
|
|
35
|
+
* Instrument a Redux store for action capture (fallback path).
|
|
26
36
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
37
|
+
* Patches store.dispatch to capture top-level dispatches. No-ops (but still
|
|
38
|
+
* registers the store for getState/dispatch) when the enhancer or the
|
|
39
|
+
* explicit middleware is already capturing.
|
|
29
40
|
*
|
|
30
|
-
* @param store - The Redux store to instrument
|
|
31
|
-
* @param options - Configuration options
|
|
32
41
|
* @returns Cleanup function to restore original dispatch
|
|
33
42
|
*/
|
|
34
43
|
export declare function instrumentStore(store: Store, options?: AutoInstrumentOptions): () => void;
|
|
35
44
|
/**
|
|
36
|
-
* Remove instrumentation from a store
|
|
45
|
+
* Remove dispatch-patch instrumentation from a store.
|
|
46
|
+
*
|
|
47
|
+
* Only restores the patched dispatch. (This used to also replaceReducer with a
|
|
48
|
+
* synthetic reducer that froze the host store permanently — that path is gone.)
|
|
49
|
+
* Enhancer-created stores are left untouched apart from the registry.
|
|
37
50
|
*/
|
|
38
51
|
export declare function uninstrumentStore(store: Store): void;
|
|
39
52
|
/**
|
|
40
|
-
*
|
|
53
|
+
* Manually register a store with Buoy — the escape hatch for apps that can't
|
|
54
|
+
* render FloatingDevTools inside a react-redux Provider (or don't use
|
|
55
|
+
* react-redux at all). Instruments via the fallback dispatch patch.
|
|
56
|
+
*
|
|
57
|
+
* Prefer the zero-config paths; this exists so no app is ever stuck.
|
|
58
|
+
*/
|
|
59
|
+
export declare function registerReduxStore(store: Store, options?: AutoInstrumentOptions): () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Jump to a specific state (time-travel).
|
|
41
62
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
63
|
+
* Real on the enhancer path (reducer is wrapped from creation) and on the
|
|
64
|
+
* middleware path when the app used `withBuoyDevTools`. On the bare patch
|
|
65
|
+
* path there's no reducer wrapper, so the jump action is ignored — we detect
|
|
66
|
+
* that and warn once instead of pretending it worked.
|
|
44
67
|
*/
|
|
45
68
|
export declare function jumpToState(state: unknown): void;
|
|
46
69
|
/**
|
|
@@ -48,15 +71,15 @@ export declare function jumpToState(state: unknown): void;
|
|
|
48
71
|
*/
|
|
49
72
|
export declare function replayAction(action: UnknownAction): void;
|
|
50
73
|
/**
|
|
51
|
-
* Get the currently active (instrumented) store
|
|
74
|
+
* Get the currently active (instrumented) store.
|
|
75
|
+
*
|
|
76
|
+
* NOTE: on the middleware path this is the middleware `storeApi`
|
|
77
|
+
* ({getState, dispatch}) rather than the full Store object — every consumer
|
|
78
|
+
* in this package only needs those two.
|
|
52
79
|
*/
|
|
53
|
-
export declare function getActiveStore():
|
|
80
|
+
export declare function getActiveStore(): ActiveReduxStore | null;
|
|
54
81
|
/**
|
|
55
82
|
* Check if auto-instrumentation is active
|
|
56
83
|
*/
|
|
57
84
|
export declare function isAutoInstrumentActive(): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Check if time-travel support is enabled
|
|
60
|
-
*/
|
|
61
|
-
export declare function isTimeTravelEnabled(): boolean;
|
|
62
85
|
//# sourceMappingURL=autoInstrument.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/autoInstrument.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/autoInstrument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAsB/B,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAGzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,OAAO,GAAE,qBAA0B,GAClC,MAAM,IAAI,CAuFZ;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAapD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,OAAO,GAAE,qBAA0B,GAClC,MAAM,IAAI,CAEZ;AASD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAoBhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAOxD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,gBAAgB,GAAG,IAAI,CAExD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
|
|
@@ -23,7 +23,11 @@ export declare function isMiddlewareActive(): boolean;
|
|
|
23
23
|
export declare const BUOY_JUMP_TO_STATE = "@@buoy/JUMP_TO_STATE";
|
|
24
24
|
export declare const BUOY_REPLAY_ACTION = "@@buoy/REPLAY_ACTION";
|
|
25
25
|
/**
|
|
26
|
-
* Jump to a specific state (time-travel)
|
|
26
|
+
* Jump to a specific state (time-travel).
|
|
27
|
+
*
|
|
28
|
+
* Registry-backed, so it works on EVERY capture path (enhancer, middleware,
|
|
29
|
+
* patch) — previously this only worked when the middleware was installed,
|
|
30
|
+
* which silently broke the modal's Jump button on the zero-config path.
|
|
27
31
|
*/
|
|
28
32
|
export declare function jumpToState(state: unknown): void;
|
|
29
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buoyReduxMiddleware.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/buoyReduxMiddleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"buoyReduxMiddleware.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/buoyReduxMiddleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAc3D;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAMD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAczD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAOhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAOxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAWnE;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,UA4BjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,0BAA+B,GACvC,UAAU,CAoCZ"}
|