From 2bd8e134a2aee55e2c88bc62855c89deef4edeab Mon Sep 17 00:00:00 2001 From: Jixun Wu Date: Wed, 10 May 2023 23:16:12 +0100 Subject: [PATCH] chore: use singleton loader to prevent duplicated wasm request --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- src/WasmTest.tsx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7a4b8d9..f48bc7a 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@chakra-ui/react": "^2.6.1", "@emotion/react": "^11.11.0", "@emotion/styled": "^11.11.0", - "@jixun/libparakeet": "0.0.0-exp5", + "@jixun/libparakeet": "0.0.0-exp6", "@reduxjs/toolkit": "^1.9.5", "framer-motion": "^10.12.8", "nanoid": "^4.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ce68ee..d1388dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^11.11.0 version: 11.11.0(@emotion/react@11.11.0)(@types/react@18.0.28)(react@18.2.0) '@jixun/libparakeet': - specifier: 0.0.0-exp5 - version: 0.0.0-exp5 + specifier: 0.0.0-exp6 + version: 0.0.0-exp6 '@reduxjs/toolkit': specifier: ^1.9.5 version: 1.9.5(react-redux@8.0.5)(react@18.2.0) @@ -1780,8 +1780,8 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true - /@jixun/libparakeet@0.0.0-exp5: - resolution: {integrity: sha512-qDGhEYEDUCl3GvpeVfBU7Jd6KuONULQUaA/SpBdKDT5sSuM+fgLIAwD7gxaR+Rp05QGLnG6VNKoLXMmvuW9JPQ==} + /@jixun/libparakeet@0.0.0-exp6: + resolution: {integrity: sha512-hxItnn7nMKnmgSEnFXtbkud9KmxtQrBQzM/oMRpl4hfgVL0PxnTMJtoyKCYR0MGOuQ/+M+Ehc8rLi4Ex/rRdTg==} dev: false /@jridgewell/gen-mapping@0.3.3: diff --git a/src/WasmTest.tsx b/src/WasmTest.tsx index e85e9f8..eb987b6 100644 --- a/src/WasmTest.tsx +++ b/src/WasmTest.tsx @@ -1,7 +1,7 @@ -import { LibParakeetInit, BlobSink, createArrayBufferReader } from '@jixun/libparakeet'; +import { loadLibParakeet, BlobSink, createArrayBufferReader } from '@jixun/libparakeet'; function testWasm() { - LibParakeetInit().then(async (mod) => { + loadLibParakeet().then(async (mod) => { const data = new Uint8Array(0x2000); for (let i = 0; i < data.byteLength; i++) { data[i] = i & 0xff;