Please upgrade source-map to 0.7.2 to get speed improvements
The latest source-map which is v0.7.2 got support for WebAssembly and it is 10 times faster than the old one. More info here:
https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#072 http://fitzgeraldnick.com/2018/02/26/speed-without-wizardry.html https://hacks.mozilla.org/2018/01/oxidizing-source-maps-with-rust-and-webassembly/ https://github.com/devtools-html/debugger.html/issues/5598
Please update so you would get 10 times speed improvements for your library in Firefox, 9 times in Safari and 5 times in Chrome.
This is awesome, we need to figure out what breaking changes (if any) occurred in 0.7.0, then we are good to go!
PRs welcome!
Breaking change: Drop support for Node < 8. If you want to support older versions of node, please use v0.6 or below.
Hmmmm, this might be a big problem for us... 🤔
Is this possible? SourceMapConsumer now returns a Promise, but catching and mapping thrown exceptions needs to be synchronous.
Jest is also unable to upgrade due to the lack of a sync API, FWIW
@SimenB Could deasync help here? It hooks into Node's event loop and essentially makes any async operation a sync one.
I published https://www.npmjs.com/package/@snek/source-map-support which works nicely in node and may work in browsers that allow you to load reasonable sized wasms synchronously. It wraps the 0.8.0-beta.0 release of source-map.
@andreicristianpetcu @devsnek there is no case for async source map consumer other than problems of specific ill-thought implementation by Mozilla. Like: await in stack trace handler? Are they nuts?
@cspotcode/source-map-support uses @cspotcode/source-map-consumer which is a fork of source-map that only has the consumer. @cspotcode/source-map includes the generator, too.
These are based on the latest source-map version. They use WASM and have a sync API.
You might have luck giving them a try. It's all open-source, so of course the changes can be ported over.
This will also fix an annoying issue in VS Code.
source-map@<0.7.1 has an invalid typings field in its package.json which is causing VS Code to report an error that it can't find the type declarations. This is fixed in source-map@>=0.7.1.
Babel has migrated to https://npmjs.com/package/@jridgewell/trace-mapping, should this module as well? Code change seems fairly trivial (no idea about browser support, but probably?)
Has anyone done benchmarks of the various options? I haven't, so I really don't know if they're different: if wasm is faster/slower/whatever.
EDIT: I see them in the README now. Will check them out.
Jest and C8 (via v8-to-istanbul) has also migrated, fwiw
I can migrate @cspotcode/source-map-support as well.
Would be nice to consolidate the ecosystem a bit more.