feat: removes zustand dev tools

This commit is contained in:
Mark Mankarious
2023-08-08 14:28:45 +01:00
parent f1f77d4eca
commit 4a4f168671
5 changed files with 7 additions and 37 deletions

21
package-lock.json generated
View File

@@ -22,7 +22,6 @@
"react-hook-form": "^7.43.2",
"react-quill": "^2.0.0",
"react-router-dom": "^6.8.1",
"simple-zustand-devtools": "^1.1.0",
"uuid": "^9.0.0",
"zod": "^3.20.6",
"zustand": "^4.3.3"
@@ -2844,6 +2843,7 @@
"version": "18.0.11",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.11.tgz",
"integrity": "sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==",
"dev": true,
"dependencies": {
"@types/react": "*"
}
@@ -12737,18 +12737,6 @@
"node": ">=10"
}
},
"node_modules/simple-zustand-devtools": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/simple-zustand-devtools/-/simple-zustand-devtools-1.1.0.tgz",
"integrity": "sha512-Axfcfr9L3YL3kto7aschCQLY2VUlXXMnIVtaTe9Y0qWbNmPsX/y7KsNprmxBZoB0pww5ZGs1u/ohcrvQ3tE6jA==",
"peerDependencies": {
"@types/react": ">=18.0.0",
"@types/react-dom": ">=18.0.0",
"react": ">=18.0.0",
"react-dom": ">=18.0.0",
"zustand": ">=1.0.2"
}
},
"node_modules/sisteransi": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
@@ -16709,6 +16697,7 @@
"version": "18.0.11",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.11.tgz",
"integrity": "sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==",
"dev": true,
"requires": {
"@types/react": "*"
}
@@ -24071,12 +24060,6 @@
"semver": "^7.5.3"
}
},
"simple-zustand-devtools": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/simple-zustand-devtools/-/simple-zustand-devtools-1.1.0.tgz",
"integrity": "sha512-Axfcfr9L3YL3kto7aschCQLY2VUlXXMnIVtaTe9Y0qWbNmPsX/y7KsNprmxBZoB0pww5ZGs1u/ohcrvQ3tE6jA==",
"requires": {}
},
"sisteransi": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",

View File

@@ -74,7 +74,6 @@
"react-hook-form": "^7.43.2",
"react-quill": "^2.0.0",
"react-router-dom": "^6.8.1",
"simple-zustand-devtools": "^1.1.0",
"uuid": "^9.0.0",
"zod": "^3.20.6",
"zustand": "^4.3.3"

View File

@@ -18,6 +18,7 @@ import { GlobalStyles } from 'src/styles/GlobalStyles';
import { Renderer } from 'src/components/Renderer/Renderer';
import { LabelContainer } from 'src/components/Node/LabelContainer';
import { useWindowUtils } from 'src/hooks/useWindowUtils';
import { sceneInput as sceneValidationSchema } from 'src/validation/scene';
import { ItemControlsManager } from './components/ItemControls/ItemControlsManager';
import { UiStateProvider, useUiStateStore } from './stores/uiStateStore';
@@ -121,5 +122,6 @@ export {
GroupInput,
ConnectorInput,
useIsoflow,
LabelContainer
LabelContainer,
sceneValidationSchema
};

View File

@@ -1,6 +1,5 @@
import React, { createContext, useRef, useContext, useEffect } from 'react';
import React, { createContext, useRef, useContext } from 'react';
import { createStore, useStore } from 'zustand';
import { mountStoreDevtool } from 'simple-zustand-devtools';
import { v4 as uuid } from 'uuid';
import { produce } from 'immer';
import { NODE_DEFAULTS } from 'src/config';
@@ -93,12 +92,6 @@ export function useSceneStore<T>(
) {
const store = useContext(SceneContext);
useEffect(() => {
if (process.env.NODE_ENV === 'development') {
mountStoreDevtool('SceneStore', store);
}
}, [store]);
if (store === null) {
throw new Error('Missing provider in the tree');
}

View File

@@ -1,6 +1,5 @@
import React, { createContext, useContext, useRef, useEffect } from 'react';
import React, { createContext, useContext, useRef } from 'react';
import { createStore, useStore } from 'zustand';
import { mountStoreDevtool } from 'simple-zustand-devtools';
import { CoordsUtils, incrementZoom, decrementZoom } from 'src/utils';
import { UiState, UiStateActions } from 'src/types';
@@ -105,12 +104,6 @@ export const UiStateProvider = ({ children }: ProviderProps) => {
export function useUiStateStore<T>(selector: (state: UiStateStore) => T) {
const store = useContext(UiStateContext);
useEffect(() => {
if (process.env.NODE_ENV === 'development') {
mountStoreDevtool('UIStore', store);
}
}, [store]);
if (store === null) {
throw new Error('Missing provider in the tree');
}