Skip to content

Commit

Permalink
Remove lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkmcc committed Jan 16, 2024
1 parent 46dfb0d commit aa753ad
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/components/NodeHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { memo, useMemo, useState } from 'react'
import { useNodeFieldValue } from '../hooks/node'
import './NodeHeader.css'
import { GoTriangleDown, GoTriangleRight } from 'react-icons/go'
import { isEqual } from 'lodash-es'
import './NodeHeader.scss'

type NodeHeaderProps = {
defaultTitle: string
Expand Down
3 changes: 1 addition & 2 deletions lib/node-types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { useGraphConfig } from './context/GraphConfigContext'
import { NodeOutputField } from './components/NodeOutputField'
import { NodeContainer } from './components/NodeContainer'
import { useFocusBlur } from './hooks/focus'
import { isEqual } from 'lodash-es'
import { Handle } from './components/Handle.tsx'
import { InputGroup } from './components/InputGroup.tsx'

Expand All @@ -31,7 +30,7 @@ import { InputGroup } from './components/InputGroup.tsx'
* @param b {Node}
*/
const isComponentChanged = (a: Node, b: Node) =>
a.selected === b.selected && isEqual(a.data, b.data)
a.selected === b.selected && JSON.stringify(a.data) === JSON.stringify(b.data) // switched from lodash because bundle size was so large

export function buildNode(nodeConfig: NodeConfig): FunctionComponent<Node> {
function component(node: Node): ReactElement {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"dependencies": {
"@uiw/react-color": "^2.0.6",
"dagre": "^0.8.5",
"lodash-es": "^4.17.21",
"nanoid": "^5.0.4",
"react-hotkeys-hook": "^4.4.3",
"react-icons": "^5.0.1",
Expand Down

0 comments on commit aa753ad

Please sign in to comment.