-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump source-map dependency #140
Comments
Referencing mozilla/source-map#331, I don't think it's possible to use versions higher than 0.6.1 which is what we're targeting. Is there is some new feature of It might be worth making your case for needing a sync version of the latest |
I am trying to upgrade the source-map dependency for many reasons, mainly because the dependencies of this project have not been updated for 2 to 3 years so I am basically trying to upgrade everything to increase the global stability and get the benefits of performance improvements. Using the async version of source-map can be really great because parsing a source-map requires a lot of computation compared to the other operations that a screeps script does, so doing it asynchronously can help I guess. |
So I would say that I "need" the performance improvements that have been made since the The async parsing is not a problem for me, which is different from the issue you referenced: I just need to figure out a clean way to handle it. |
@pyrodogg What is the problem to asynchronously throw errors? |
The problem isn't inherently that it's an async library. Promises do exist and operate within the screeps game loop. The problem really comes from looking at why // https://github.com/mozilla/source-map/blob/master/lib/read-wasm.js
const fs = require("fs");
const path = require("path");
module.exports = function readWasm() {
return new Promise((resolve, reject) => {
const wasmPath = path.join(__dirname, "mappings.wasm");
fs.readFile(wasmPath, null, (error, data) => {
if (error) {
reject(error);
return;
}
resolve(data.buffer);
});
});
}; It's async because it's reading the wasm module with There are other issues on that project that seems to point at working around it. It looks like node version of |
Hi!
I am trying to locally upgrade the
source-map
dependency.As of now, the following code is initializing it:
However, the new
SourceMapConsumer
now returns a promise, which makes the source-map parsing asynchronous.The problem is that a getter cannot be async.
How can I handle this?
I am considering doing a PR after I resolve this.
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: