diff --git a/packages/core/package.json b/packages/core/package.json index a272e3d5..f3b95202 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -53,12 +53,12 @@ "access": "public" }, "devDependencies": { - "@types/lodash": "4.17.24", + "@types/lodash-es": "4.17.12", "@webgpu/types": "0.1.71" }, "dependencies": { "@alleninstitute/vis-geometry": "workspace:*", - "lodash": "4.18.1", + "lodash-es": "4.18.1", "regl": "2.1.1", "uuid": "14.0.1", "webgpu-utils": "2.1.1", diff --git a/packages/core/src/abstract/async-frame.ts b/packages/core/src/abstract/async-frame.ts index 5b951550..790cedbf 100644 --- a/packages/core/src/abstract/async-frame.ts +++ b/packages/core/src/abstract/async-frame.ts @@ -1,4 +1,4 @@ -import partial from 'lodash/partial'; +import { partial } from 'lodash-es'; import type REGL from 'regl'; import type { AsyncDataCache } from '../dataset-cache'; import type { ReglCacheEntry, Renderer } from './types'; diff --git a/packages/core/src/render-queue.ts b/packages/core/src/render-queue.ts index 851b3fe5..a9d7f8ec 100644 --- a/packages/core/src/render-queue.ts +++ b/packages/core/src/render-queue.ts @@ -1,4 +1,4 @@ -import partial from 'lodash/partial'; +import { partial } from 'lodash-es'; import type { AsyncDataCache } from './dataset-cache'; /** diff --git a/packages/core/src/rendering/webgpu/filter/query.ts b/packages/core/src/rendering/webgpu/filter/query.ts index a70e70b6..5a63e279 100644 --- a/packages/core/src/rendering/webgpu/filter/query.ts +++ b/packages/core/src/rendering/webgpu/filter/query.ts @@ -27,8 +27,7 @@ import type { vKeys, ITable, } from './types'; -import * as lo from 'lodash'; -const { mapValues } = lo; +import { mapValues } from 'lodash-es'; const entries = (r: T): ReadonlyArray<[string, T[keyof T]]> => Object.entries(r); diff --git a/packages/core/src/shared-priority-cache/shared-cache.ts b/packages/core/src/shared-priority-cache/shared-cache.ts index c990ab42..c341db9a 100644 --- a/packages/core/src/shared-priority-cache/shared-cache.ts +++ b/packages/core/src/shared-priority-cache/shared-cache.ts @@ -1,6 +1,6 @@ import { type Store, type Cacheable, type FetchResult, AsyncPriorityCache } from './priority-cache'; import { mergeAndAdd, prioritizeCacheKeys, priorityDelta } from './utils'; -import uniqueId from 'lodash/uniqueId'; +import { uniqueId } from 'lodash-es'; // goal: we want clients of the cache to experience a type-safe interface - // they expect that the things coming out of the cache are the type they expect (what they put in it) diff --git a/packages/core/src/shared-priority-cache/test-utils.ts b/packages/core/src/shared-priority-cache/test-utils.ts index 98890fae..bac86cda 100644 --- a/packages/core/src/shared-priority-cache/test-utils.ts +++ b/packages/core/src/shared-priority-cache/test-utils.ts @@ -1,5 +1,5 @@ import type { Cacheable, Store } from './priority-cache'; -import { uniqueId } from 'lodash'; +import { uniqueId } from 'lodash-es'; export class PayloadFactory { resources: Record; diff --git a/packages/core/src/test/render-cache.test.ts b/packages/core/src/test/render-cache.test.ts index 26ec2da3..12353e50 100644 --- a/packages/core/src/test/render-cache.test.ts +++ b/packages/core/src/test/render-cache.test.ts @@ -1,4 +1,4 @@ -import { partial, uniqueId } from 'lodash'; +import { partial, uniqueId } from 'lodash-es'; import { beforeEach, describe, expect, it } from 'vitest'; import { AsyncDataCache } from '../dataset-cache'; type Columns = 'color' | 'position'; diff --git a/packages/core/src/test/render-queue.test.ts b/packages/core/src/test/render-queue.test.ts index eb19c9a6..1a7da6d3 100644 --- a/packages/core/src/test/render-queue.test.ts +++ b/packages/core/src/test/render-queue.test.ts @@ -1,4 +1,4 @@ -import delay from 'lodash/delay'; +import { delay } from 'lodash-es'; import { beforeEach, describe, expect, it } from 'vitest'; import { AsyncDataCache } from '../dataset-cache'; import { type NormalStatus, beginLongRunningFrame } from '../render-queue'; diff --git a/packages/core/src/test/test-utils.ts b/packages/core/src/test/test-utils.ts index 0aa777d4..9e551dd7 100644 --- a/packages/core/src/test/test-utils.ts +++ b/packages/core/src/test/test-utils.ts @@ -1,4 +1,4 @@ -import { delay } from 'lodash'; +import { delay } from 'lodash-es'; export const fakeFetch = (data: FakeTask, signal?: AbortSignal): Promise => new Promise((resolve, reject) => { diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 70656cec..d7a33aa0 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -8,7 +8,7 @@ "module": "es6", "target": "es2024", "lib": ["es2024", "DOM"], - "types": ["@webgpu/types", "lodash"] + "types": ["@webgpu/types", "lodash-es"] }, "include": ["./src/index.ts"] } diff --git a/packages/scatterbrain/package.json b/packages/scatterbrain/package.json index 6ed012d0..43c2ff4c 100644 --- a/packages/scatterbrain/package.json +++ b/packages/scatterbrain/package.json @@ -52,7 +52,7 @@ "dependencies": { "@alleninstitute/vis-core": "workspace:*", "@alleninstitute/vis-geometry": "workspace:*", - "lodash": "4.18.1", + "lodash-es": "4.18.1", "regl": "2.1.0", "ts-pattern": "5.9.0", "zod": "4.4.3" @@ -62,6 +62,6 @@ "access": "public" }, "devDependencies": { - "@types/lodash": "4.17.24" + "@types/lodash-es": "4.17.12" } } diff --git a/packages/scatterbrain/src/cache-client.ts b/packages/scatterbrain/src/cache-client.ts index 384cf778..683a0566 100644 --- a/packages/scatterbrain/src/cache-client.ts +++ b/packages/scatterbrain/src/cache-client.ts @@ -1,5 +1,5 @@ import type { Cacheable, SharedPriorityCache } from '@alleninstitute/vis-core'; -import reduce from 'lodash/reduce'; +import { reduce } from 'lodash-es'; import type { WebGLSafeBasicType } from './typed-array'; import type { ColumnRequest, Item } from './types'; diff --git a/packages/scatterbrain/src/dataset.ts b/packages/scatterbrain/src/dataset.ts index bebfc1e5..051f3cfe 100644 --- a/packages/scatterbrain/src/dataset.ts +++ b/packages/scatterbrain/src/dataset.ts @@ -10,7 +10,7 @@ import { visitBFSMaybe, } from '@alleninstitute/vis-geometry'; import type { PointAttribute, ScatterbrainDataset, SlideviewScatterbrainDataset, TreeNode, volumeBound } from './types'; -import reduce from 'lodash/reduce'; +import { reduce } from 'lodash-es'; import * as z from 'zod'; type Dataset = ScatterbrainDataset | SlideviewScatterbrainDataset; diff --git a/packages/scatterbrain/src/renderer.ts b/packages/scatterbrain/src/renderer.ts index 7fa79cb9..60eb8de7 100644 --- a/packages/scatterbrain/src/renderer.ts +++ b/packages/scatterbrain/src/renderer.ts @@ -1,7 +1,6 @@ import type { SharedPriorityCache } from '@alleninstitute/vis-core'; import { Box2D, type box2D, type vec4 } from '@alleninstitute/vis-geometry'; -import keys from 'lodash/keys'; -import reduce from 'lodash/reduce'; +import { keys, reduce } from 'lodash-es'; import type REGL from 'regl'; import { buildScatterbrainCacheClient } from './cache-client'; import { getVisibleItems, type NodeWithBounds } from './dataset'; diff --git a/packages/scatterbrain/src/shader.ts b/packages/scatterbrain/src/shader.ts index 386de097..d20d3a0a 100644 --- a/packages/scatterbrain/src/shader.ts +++ b/packages/scatterbrain/src/shader.ts @@ -2,8 +2,7 @@ import type REGL from 'regl'; import type { ScatterbrainDataset, SlideviewScatterbrainDataset } from './types'; import type { Cacheable, CachedVertexBuffer } from '@alleninstitute/vis-core'; import { Box2D, type box2D, type Interval, type vec2, type vec4 } from '@alleninstitute/vis-geometry'; -import * as lodash from 'lodash'; -const { keys, mapValues, reduce } = lodash; +import { keys, mapValues, reduce } from 'lodash-es'; // the set of columns and what to do with them can vary // there might be 3 categorical columns and 2 range columns diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 175f885b..ae9a5b01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,7 +53,7 @@ importers: '@alleninstitute/vis-geometry': specifier: workspace:* version: link:../geometry - lodash: + lodash-es: specifier: 4.18.1 version: 4.18.1 regl: @@ -69,9 +69,9 @@ importers: specifier: 4.4.3 version: 4.4.3 devDependencies: - '@types/lodash': - specifier: 4.17.24 - version: 4.17.24 + '@types/lodash-es': + specifier: 4.17.12 + version: 4.17.12 '@webgpu/types': specifier: 0.1.71 version: 0.1.71 @@ -116,7 +116,7 @@ importers: '@alleninstitute/vis-geometry': specifier: workspace:* version: link:../geometry - lodash: + lodash-es: specifier: 4.18.1 version: 4.18.1 regl: @@ -129,9 +129,9 @@ importers: specifier: 4.4.3 version: 4.4.3 devDependencies: - '@types/lodash': - specifier: 4.17.24 - version: 4.17.24 + '@types/lodash-es': + specifier: 4.17.12 + version: 4.17.12 site: dependencies: @@ -162,9 +162,9 @@ importers: '@astrojs/starlight': specifier: 0.37.6 version: 0.37.6(astro@5.17.1(@types/node@22.1.0)(lightningcss@1.30.2)(rollup@4.62.3)(typescript@5.9.3)(yaml@2.8.1)) - '@types/lodash': - specifier: 4.17.23 - version: 4.17.23 + '@types/lodash-es': + specifier: 4.17.12 + version: 4.17.12 '@types/react': specifier: 19.2.13 version: 19.2.13 @@ -183,9 +183,9 @@ importers: kiwi-schema: specifier: 0.5.0 version: 0.5.0 - lodash: - specifier: 4.17.23 - version: 4.17.23 + lodash-es: + specifier: 4.18.1 + version: 4.18.1 react: specifier: 19.2.4 version: 19.2.4 @@ -2087,11 +2087,11 @@ packages: '@types/js-yaml@4.0.9': resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} - '@types/lodash@4.17.23': - resolution: {integrity: sha512-RDvF6wTulMPjrNdCoYRC8gNR880JNGT8uB+REUpC2Ns4pRqQJhGz90wh7rgdXDPpCczF3VGktDuFGVnz8zP7HA==} + '@types/lodash-es@4.17.12': + resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} - '@types/lodash@4.17.24': - resolution: {integrity: sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ==} + '@types/lodash@4.17.25': + resolution: {integrity: sha512-+K1NIO8I+F9/wNulfVvu23QYd0Pe9/OCqRrim4NoYIf1VoEDL90Ve4ClzpyqBLc7NpGGWRvYNCKZ1BE/Jpf8dQ==} '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} @@ -3029,15 +3029,12 @@ packages: resolution: {integrity: sha512-9bMdFfc80S+vSldBmG3HOuLVHnxRdNTlpzR6QDnzqCQtCzGUEAGTzBKYMeIM+I/sU4oZfgbcbS7X7F65/z/oxQ==} hasBin: true + lodash-es@4.18.1: + resolution: {integrity: sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==} + lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - lodash@4.17.23: - resolution: {integrity: sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==} - - lodash@4.18.1: - resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} - longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} @@ -6115,9 +6112,11 @@ snapshots: '@types/js-yaml@4.0.9': {} - '@types/lodash@4.17.23': {} + '@types/lodash-es@4.17.12': + dependencies: + '@types/lodash': 4.17.25 - '@types/lodash@4.17.24': {} + '@types/lodash@4.17.25': {} '@types/mdast@4.0.4': dependencies: @@ -7272,11 +7271,9 @@ snapshots: '@lmdb/lmdb-linux-x64': 2.8.5 '@lmdb/lmdb-win32-x64': 2.8.5 - lodash@4.17.21: {} - - lodash@4.17.23: {} + lodash-es@4.18.1: {} - lodash@4.18.1: {} + lodash@4.17.21: {} longest-streak@3.1.0: {} diff --git a/site/package.json b/site/package.json index c95f1658..b5a12e7d 100644 --- a/site/package.json +++ b/site/package.json @@ -55,14 +55,14 @@ "@astrojs/mdx": "4.3.13", "@astrojs/react": "4.4.2", "@astrojs/starlight": "0.37.6", - "@types/lodash": "4.17.23", + "@types/lodash-es": "4.17.12", "@types/react": "19.2.13", "@types/react-dom": "19.2.3", "astro": "5.17.1", "file-saver": "2.0.5", "json5": "2.2.3", "kiwi-schema": "0.5.0", - "lodash": "4.17.23", + "lodash-es": "4.18.1", "react": "19.2.4", "react-dom": "19.2.4", "regl": "2.1.1", diff --git a/site/src/examples/common/loaders/ome-zarr/sliceWorkerPool.ts b/site/src/examples/common/loaders/ome-zarr/sliceWorkerPool.ts index 1c167e9c..653238f2 100644 --- a/site/src/examples/common/loaders/ome-zarr/sliceWorkerPool.ts +++ b/site/src/examples/common/loaders/ome-zarr/sliceWorkerPool.ts @@ -1,5 +1,5 @@ import type { Decoder, OmeZarrMetadata, OmeZarrShapedDataset, ZarrRequest } from '@alleninstitute/vis-omezarr'; -import uniqueId from 'lodash/uniqueId'; +import { uniqueId } from 'lodash-es'; import type { ZarrSliceRequest } from './types'; type PromisifiedMessage = { diff --git a/site/src/examples/data-renderers/simpleAnnotationRenderer.ts b/site/src/examples/data-renderers/simpleAnnotationRenderer.ts index 24e28a43..439a29ae 100644 --- a/site/src/examples/data-renderers/simpleAnnotationRenderer.ts +++ b/site/src/examples/data-renderers/simpleAnnotationRenderer.ts @@ -1,6 +1,6 @@ import { Box2D, type box2D } from '@alleninstitute/vis-geometry'; import { type AsyncDataCache, beginLongRunningFrame } from '@alleninstitute/vis-core'; -import flatten from 'lodash/flatten'; +import { flatten } from 'lodash-es'; import type REGL from 'regl'; import type { Camera } from '../common/camera'; import type { ColumnData } from '../common/loaders/scatterplot/scatterbrain-loader'; diff --git a/site/src/examples/data-renderers/versa-renderer.ts b/site/src/examples/data-renderers/versa-renderer.ts index e3ead7da..4d7016c6 100644 --- a/site/src/examples/data-renderers/versa-renderer.ts +++ b/site/src/examples/data-renderers/versa-renderer.ts @@ -15,7 +15,7 @@ import { sizeInUnits, } from '@alleninstitute/vis-omezarr'; import { logger } from '@alleninstitute/vis-core'; -import omit from 'lodash/omit'; +import { omit } from 'lodash-es'; import type REGL from 'regl'; import type { Framebuffer2D } from 'regl'; import type { Camera } from '../common/camera';