Skip to content

how can I export or import data in Uint8Array format when using wasm version? #203

Answered by isaac-mason
liushzhql asked this question in Q&A
Discussion options

You must be logged in to vote

There's a related issue for letting users choose their wasm build, I'm not working on it right now though: #164

I'm hoping in future I can support something like this in user-land:

import { init } from 'recast-navigation'
import MyChosenRecastBuild from '@recast-navigation/wasm/wasm-compat'

await init(MyChosenRecastBuild)

Also, I haven't tested what the performance is like with asmjs, but I suspect it will be very bad 🙂 just a warning.


Regarding your immediate issue, there's a few things we need to do to fix those entrypoints:

  • those entrypoints also need a "types" entry for typescript support
  • consuming packages (including e.g. @recast-navigation/core) need to use a tsconfig.json module…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@liushzhql
Comment options

@isaac-mason
Comment options

@liushzhql
Comment options

@isaac-mason
Comment options

Answer selected by liushzhql
@liushzhql
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #201 on November 17, 2023 05:00.