Skip to content

Update zarrita.js #92

@will-moore

Description

@will-moore

In looking to use ome-zarr.js for rendering thumbnails, I npm install ome-zarr.js but before updating the code to use that library, I found that thumbnails had broken with the existing code, which seems to be due to the update of zarrita.js.

Starting from scratch (master branch, thumbnails OK with $ npm run dev), uses zarrita@0.4.0-next.15.
Then...

npm install zarrita@0.4.0-next.16
npm run dev

Thumbnails still working OK...

npm install zarrita@0.4.0-next.17
npm run dev

Thumbnails not working.

See console errors:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'TypedArray')

coming from:

async function get(arr, selection, opts, setter2) {
  var _a2;
  let context = get_context(arr);
  let indexer = new BasicIndexer({
    selection,
    shape: arr.shape,
    chunk_shape: arr.chunks
  });
> let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a, b) => a * b, 1)), indexer.shape, context.get_strides(indexer.shape));
git diff
diff --git a/ome2024-ngff-challenge/package-lock.json b/ome2024-ngff-challenge/package-lock.json
index f1861f1..0f2ff8e 100644
--- a/ome2024-ngff-challenge/package-lock.json
+++ b/ome2024-ngff-challenge/package-lock.json
@@ -10,7 +10,7 @@
       "dependencies": {
         "papaparse": "^5.4.1",
         "svelte-tiny-virtual-list": "^2.1.2",
-        "zarrita": "^0.4.0-next.15"
+        "zarrita": "^0.4.0-next.17"
       },
       "devDependencies": {
         "@sveltejs/vite-plugin-svelte": "^3.1.1",
@@ -701,39 +701,53 @@
       "dev": true
     },
     "node_modules/@zarrita/core": {
-      "version": "0.1.0-next.14",
-      "resolved": "https://registry.npmjs.org/@zarrita/core/-/core-0.1.0-next.14.tgz",
-      "integrity": "sha512-tsCZhqGU4S1YlNfPMAvw3nJodPxLgXqRSrpYF5Mf4gsi2fxDymNmJA2oSxuA4lLqTDCcvPBCubYykyF9ADxArw==",
+      "version": "0.1.0-next.24",
+      "resolved": "https://registry.npmjs.org/@zarrita/core/-/core-0.1.0-next.24.tgz",
+      "integrity": "sha512-KBenVZ1c2koRiqNbnrmz4H6d+QN/24ON5XAD0L6yWWXG7MC6onFr2DBjyqnZyytXXlVQf7pHxnrLdhW+Mecu4g==",
+      "license": "MIT",
       "dependencies": {
-        "@zarrita/storage": "^0.1.0-next.6",
-        "@zarrita/typedarray": "^0.1.0-next.3",
-        "numcodecs": "^0.3.1"
+        "zarrita": "^0.4.0-next.27"
+      }
+    },
+    "node_modules/@zarrita/core/node_modules/zarrita": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/zarrita/-/zarrita-0.4.0.tgz",
+      "integrity": "sha512-MK2uustzUF0PooWl6HVUfTares/nmaq5NwRZux/L3npvkSX6Qdpd7w/NOW2cF9EI35yqggoHNi3Nlxyq1YT5eQ==",
+      "license": "MIT",
+      "dependencies": {
+        "@zarrita/storage": "^0.1.0",
+        "numcodecs": "^0.3.2"
       }
     },
     "node_modules/@zarrita/indexing": {
-      "version": "0.1.0-next.16",
-      "resolved": "https://registry.npmjs.org/@zarrita/indexing/-/indexing-0.1.0-next.16.tgz",
-      "integrity": "sha512-cNHwpcudHz3R3mOkLe14UgTBf4Jq+gFNG4Dv+AtX93WSTLCg42YSSX6gnLBnrRIoB7KB0FUwpglDDi2R4jIZKw==",
+      "version": "0.1.0-next.26",
+      "resolved": "https://registry.npmjs.org/@zarrita/indexing/-/indexing-0.1.0-next.26.tgz",
+      "integrity": "sha512-gRxkIWb/wly9iu4yMXxAiWBqChOS3VVR4cGr263MgiicQqZBVU6+PdnvU9FERZJAmaMwaJqlSenUIcOnhcMKlQ==",
+      "license": "MIT",
       "dependencies": {
-        "@zarrita/core": "^0.1.0-next.14",
-        "@zarrita/storage": "^0.1.0-next.6",
-        "@zarrita/typedarray": "^0.1.0-next.3"
+        "zarrita": "^0.4.0-next.26"
+      }
+    },
+    "node_modules/@zarrita/indexing/node_modules/zarrita": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/zarrita/-/zarrita-0.4.0.tgz",
+      "integrity": "sha512-MK2uustzUF0PooWl6HVUfTares/nmaq5NwRZux/L3npvkSX6Qdpd7w/NOW2cF9EI35yqggoHNi3Nlxyq1YT5eQ==",
+      "license": "MIT",
+      "dependencies": {
+        "@zarrita/storage": "^0.1.0",
+        "numcodecs": "^0.3.2"
       }
     },
     "node_modules/@zarrita/storage": {
-      "version": "0.1.0-next.6",
-      "resolved": "https://registry.npmjs.org/@zarrita/storage/-/storage-0.1.0-next.6.tgz",
-      "integrity": "sha512-7e1rxCCGA6aaulYiMAZOdMJ+GxVrD01QRvIjCCc1RMKo0otYUAarX2wnoatpSy+m3e+TFjB70M+GQce0XMhNwA==",
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/@zarrita/storage/-/storage-0.1.0.tgz",
+      "integrity": "sha512-lSGDQik2fLt/UyvWzWd23sJFHckEmk50F9Baz2XlbgFQhvd2EVBcHGweOTBhu3c5SB05TzOnlY1M1i2FMDi6YA==",
+      "license": "MIT",
       "dependencies": {
         "reference-spec-reader": "^0.2.0",
         "unzipit": "^1.4.3"
       }
     },
-    "node_modules/@zarrita/typedarray": {
-      "version": "0.1.0-next.3",
-      "resolved": "https://registry.npmjs.org/@zarrita/typedarray/-/typedarray-0.1.0-next.3.tgz",
-      "integrity": "sha512-DpSaU3Cr6HmYDC/v8oM+e219cHU/kzKma309Z9E+QbpRnZycKNbSTKcxFR7FqB6HgB9640gzNUVFG5P+wzX5Xg=="
-    },
     "node_modules/acorn": {
       "version": "8.12.1",
       "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
@@ -875,7 +889,8 @@
     "node_modules/fflate": {
       "version": "0.8.2",
       "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
-      "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A=="
+      "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
+      "license": "MIT"
     },
     "node_modules/fsevents": {
       "version": "2.3.3",
@@ -958,6 +973,7 @@
       "version": "0.3.2",
       "resolved": "https://registry.npmjs.org/numcodecs/-/numcodecs-0.3.2.tgz",
       "integrity": "sha512-6YSPnmZgg0P87jnNhi3s+FVLOcIn3y+1CTIgUulA3IdASzK9fJM87sUFkpyA+be9GibGRaST2wCgkD+6U+fWKw==",
+      "license": "MIT",
       "dependencies": {
         "fflate": "^0.8.0"
       }
@@ -1015,7 +1031,8 @@
     "node_modules/reference-spec-reader": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/reference-spec-reader/-/reference-spec-reader-0.2.0.tgz",
-      "integrity": "sha512-q0mfCi5yZSSHXpCyxjgQeaORq3tvDsxDyzaadA/5+AbAUwRyRuuTh0aRQuE/vAOt/qzzxidJ5iDeu1cLHaNBlQ=="
+      "integrity": "sha512-q0mfCi5yZSSHXpCyxjgQeaORq3tvDsxDyzaadA/5+AbAUwRyRuuTh0aRQuE/vAOt/qzzxidJ5iDeu1cLHaNBlQ==",
+      "license": "MIT"
     },
     "node_modules/rollup": {
       "version": "4.21.2",
@@ -1107,6 +1124,7 @@
       "version": "1.4.3",
       "resolved": "https://registry.npmjs.org/unzipit/-/unzipit-1.4.3.tgz",
       "integrity": "sha512-gsq2PdJIWWGhx5kcdWStvNWit9FVdTewm4SEG7gFskWs+XCVaULt9+BwuoBtJiRE8eo3L1IPAOrbByNLtLtIlg==",
+      "license": "MIT",
       "dependencies": {
         "uzip-module": "^1.0.2"
       },
@@ -1117,7 +1135,8 @@
     "node_modules/uzip-module": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/uzip-module/-/uzip-module-1.0.3.tgz",
-      "integrity": "sha512-AMqwWZaknLM77G+VPYNZLEruMGWGzyigPK3/Whg99B3S6vGHuqsyl5ZrOv1UUF3paGK1U6PM0cnayioaryg/fA=="
+      "integrity": "sha512-AMqwWZaknLM77G+VPYNZLEruMGWGzyigPK3/Whg99B3S6vGHuqsyl5ZrOv1UUF3paGK1U6PM0cnayioaryg/fA==",
+      "license": "MIT"
     },
     "node_modules/vite": {
       "version": "5.4.3",
@@ -1193,13 +1212,14 @@
       }
     },
     "node_modules/zarrita": {
-      "version": "0.4.0-next.16",
-      "resolved": "https://registry.npmjs.org/zarrita/-/zarrita-0.4.0-next.16.tgz",
-      "integrity": "sha512-nCkhzMopRwDFUFDmK5RGvgvVTTf9vlElBZsrsZF97sEM3oAfv95D9VYDY7Xp489IjE6XGB8nYwsSzRO0EsUiUw==",
+      "version": "0.4.0-next.17",
+      "resolved": "https://registry.npmjs.org/zarrita/-/zarrita-0.4.0-next.17.tgz",
+      "integrity": "sha512-5vN+B+IY4GSh2JN9tqFNPJtAP20Q+eVPokDuG/TwDKn33bS3g8wyW5hENFfWLzxAEmSWvndWy+EU1xJ1Dlt5AA==",
+      "license": "MIT",
       "dependencies": {
-        "@zarrita/core": "^0.1.0-next.14",
-        "@zarrita/indexing": "^0.1.0-next.16",
-        "@zarrita/storage": "^0.1.0-next.6"
+        "@zarrita/core": "^0.1.0-next.15",
+        "@zarrita/indexing": "^0.1.0-next.17",
+        "@zarrita/storage": "^0.1.0-next.7"
       }
     }
   }
diff --git a/ome2024-ngff-challenge/package.json b/ome2024-ngff-challenge/package.json
index b3af97b..2ecffb1 100644
--- a/ome2024-ngff-challenge/package.json
+++ b/ome2024-ngff-challenge/package.json
@@ -16,6 +16,6 @@
   "dependencies": {
     "papaparse": "^5.4.1",
     "svelte-tiny-virtual-list": "^2.1.2",
-    "zarrita": "^0.4.0-next.15"
+    "zarrita": "^0.4.0-next.17"
   }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions