Skip to content
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

Source map support #490

Closed
Enerccio opened this issue Mar 28, 2018 · 6 comments
Closed

Source map support #490

Enerccio opened this issue Mar 28, 2018 · 6 comments

Comments

@Enerccio
Copy link

Is there a support for source maps in jint?

@lahma
Copy link
Collaborator

lahma commented Dec 11, 2020

What would this mean exactly? We'll close this if there's no concrete action plan.

@lahma
Copy link
Collaborator

lahma commented May 17, 2021

Closing after six months of silence.

@lahma lahma closed this as completed May 17, 2021
@thautwarm
Copy link

Source map maps the source code position from javascript to some "original" file.

This is usually useful when debugging javascript code generated from other languages(ReasonML, TypeScript, etc).

I'd like to request this feature, and if possible I'd like to help.

@thautwarm
Copy link

This can be well leveraged: https://github.com/microsoft/sourcemap-toolkit
Just add an option to ParserOption and remap the source code position.

@lofcz
Copy link
Contributor

lofcz commented Nov 30, 2022

It would be nice if we could reopen this as even if this is done on Esprima's side, there is still integration TBD in Jint. Recently, there's been good progress in enabling high I/O scenarios (async <-> Task discussion, initial work on it by @lahma, perf).

The other thing such scenarios (think server back-end) need to be maintainable is typing (end-user friendly ORM is practically impossible to do without decorators), in the case of JS, there are multiple choices (TS prominently). These languages transpiling to JS generate a standardized source map as pointed out by @thautwarm

Implementing this would hence enable debugging of TS code - along with the proposed non-blocking async interop Jint could be effectively used in many new ways.

The integration would be as proposed by @thautwarm. Along with feeding the interpreter with string code / cached Module a source map could be provided additionally. This would be decoded as described here, or see a simple overview here.

@lahma
Copy link
Collaborator

lahma commented Nov 30, 2022

We can reopen if someone wants to take the implementation task and offer PRs, otherwise it's quite moot to keep a forever issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants