Code Monkey home page Code Monkey logo

Comments (3)

isaac-mason avatar isaac-mason commented on May 16, 2024

wip branch trying the second approach here: https://github.com/isaac-mason/recast-navigation-js/tree/feat/specify-recast-impl

Right now the the wasm flavor (separate wasm file, not inlined like wasm-compat) doesn't work on node.

The emscripten build parameter ENVIRONMENT needs to be updated to include 'node' so there is node friendly logic for reading the wasm. However, these node code paths cause issues with some bundlers (at least webpack 5) due to the unrecognised node builtins. These warnings/errors can be surpressed and the build output will still work, but this is likely to cause confusion. Some bundlers such as vite don't have the issue.

Some options:

  • (short term) Accept and document that the wasm flavor doesn't work on node, and that wasm-compat should be used
  • Have a web + node wasm flavor, document the webpack 5 issue as a known issue
  • Have separate web and node wasm builds.
    • This isn't ideal, we'd need to have 4 builds (wasm-node, wasm-web, wasm-compat-node, wasm-compat-web) , and it may not be straightforward/possible to configure a package.json so the correct one is used automatically

from recast-navigation-js.

isaac-mason avatar isaac-mason commented on May 16, 2024

78cf5df

from recast-navigation-js.

isaac-mason avatar isaac-mason commented on May 16, 2024

Starting with the short term option mentioned above

(short term) Accept and document that the wasm flavor doesn't work on node, and that wasm-compat should be used

from recast-navigation-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.