Open m-rph opened 9 months ago
Can't sourcemaps be handled at the bundler level? What does llrt need to do?
Can't sourcemaps be handled at the bundler level? What does llrt need to do?
It can! It would just be convenient. But ideally, source maps should stay of the deployment artifacts in Lambda as they add size that needs to pulled in to the execution environment, which adds time. Users can get the original source by using offline approach instead like https://www.npmjs.com/package/source-map-cli
Sourcemaps are currently not supported meaning that stack traces will be from transpiled JS sources. This is not ideal for debugging purposes.
The parcel bundler has implemented support for source maps in a rust package. Its not available on crates.io but the logic of deserializing a sourcemap is not very complicated.
https://github.com/parcel-bundler/source-map/tree/master/parcel_sourcemap
Here is explanation of sourcemaps: https://www.bugsnag.com/blog/source-maps/
If this could be implemented without pulling in serde json dependency it would be ideal since the QuickJS engine already has a build in json parser