Comments (6)
With the WASM version, yes, delete is necessary. With the node version it is not.
from source-map.
I'm trying to understand the WASM version better, and I can't find the WASM artifact in the npm package.
https://unpkg.com/browse/@parcel/[email protected]/parcel_sourcemap_wasm/
Am I looking in the wrong place, or doing something unsupported?
> require('@parcel/source-map/dist/wasm-bindings')
Uncaught:
Error: Cannot find module '../parcel_sourcemap_wasm/dist-node/parcel_sourcemap_wasm.js'
from source-map.
Huh, they are missing from 2.0.1 and newer...
https://unpkg.com/browse/@parcel/[email protected]/parcel_sourcemap_wasm/
https://unpkg.com/browse/@parcel/[email protected]/parcel_sourcemap_wasm/
https://unpkg.com/browse/@parcel/[email protected]/parcel_sourcemap_wasm/
from source-map.
Are you trying to use the Wasm version from Node or in the browser? Looks like we only build the browser version anyway (which works fine with version 2.0.0 and a bundler that uses the browser
field in package.json)
To give more background to the delete question: the SourceMap
wrapped object will be GCed, but not associated memory in the Wasm memory block. At some point in the future, we could use FinalizationRegistry
to run delete
automatically.
Another thing you need to do in the wasm version is await the init
export
Line 8 in c4b0b24
so that all other operations don't have to wait for the Wasm instance to be loaded and can be synchronous (= what top-level-await was built to solve).
from source-map.
Ok thanks. Yeah I was trying to use the wasm version from node. For my use-case, it's important that I automatically and silently fallback to a non-native binary in case the native binary fails in a target environment, so I was testing if that would work. I think the async bootstrapping might also be a deal-breaker, due to legacy constraints in my project, though I do understand why WASM often necessitates it in browsers.
I appreciate your taking the time to share this information, thank you.
from source-map.
The Wasm-in-Node usecase wasn't needed by anyone so far. But in Node, this could be implement without async as well (readFileSync + new WebAssembly.Module(buffer)
).
from source-map.
Related Issues (20)
- Segfault in release builds with 2.0.3 HOT 5
- Version 2.0.4 fails with ` Cannot find module '../parcel_sourcemap_node/index'` HOT 1
- Questions on browser usage. HOT 3
- Support for Deno HOT 4
- Add source map can't concat in a single line
- Accept File URLs in a VLQ Map
- Error: Cannot find module './artifacts/index.win32-ia32-msvc.node' HOT 1
- Node crash when bundling (SourceMapBinding::addRawMappings) HOT 2
- Rust rewrite missed the README? HOT 1
- panic: 'byte index is not a char boundary' HOT 4
- missing linux arm64 build target in parcel_sourcemap_node HOT 5
- Symbol not found: ____chkstk_darwin HOT 2
- TypeScript definitions are not published
- support node >= 12 HOT 3
- extends generates wrong sourcemap HOT 2
- `Source out of range` error if source is duplicated HOT 2
- release v2.0.1 on npm and cargo HOT 4
- Unable to generate sourcemaps via parcel assets transformer api - Official Riot.js Transformer HOT 1
- Missing file for browser wasm in distributed npm package HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from source-map.