Skip to content

Commit

Permalink
fix(deps): replace hashlru with quicklru (#6557)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed May 3, 2024
1 parent 6a2cdda commit d634727
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/@sanity/vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
"@sanity/icons": "^2.11.0",
"@sanity/ui": "^2.1.4",
"@uiw/react-codemirror": "^4.11.4",
"hashlru": "^2.3.0",
"is-hotkey-esm": "^1.0.0",
"json5": "^2.2.3",
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"quick-lru": "^5.1.1"
},
"devDependencies": {
"@repo/package.config": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/vision/src/components/ResultView.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import JSONInspector from '@rexxars/react-json-inspector'
import {Code} from '@sanity/ui'
import HLRU from 'hashlru'
import LRU from 'quick-lru'

import {ResultViewWrapper} from './ResultView.styled'

const lru = HLRU(50000)
const lru = new LRU({maxSize: 50000})

export function ResultView(props: {data: unknown}) {
const {data} = props
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
"get-it": "^8.4.27",
"get-random-values-esm": "1.0.2",
"groq-js": "^1.8.0",
"hashlru": "^2.3.0",
"history": "^5.3.0",
"i18next": "^23.2.7",
"import-fresh": "^3.3.0",
Expand All @@ -222,6 +221,7 @@
"pluralize-esm": "^9.0.2",
"polished": "^4.2.2",
"pretty-ms": "^7.0.1",
"quick-lru": "^5.1.1",
"raf": "^3.4.1",
"react-copy-to-clipboard": "^5.0.4",
"react-fast-compare": "^3.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {type SanityDocumentLike} from '@sanity/types'
import HLRU from 'hashlru'
import LRU from 'quick-lru'
import {isRecord, isString} from 'sanity'

const lru = HLRU(1000)
const lru = new LRU({maxSize: 1000})

export function isExpanded(keyPath: any, value: any): any {
const cached = lru.get(keyPath)
Expand Down
21 changes: 11 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d634727

Please sign in to comment.