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

My dream spec text #105

Open
nicolo-ribaudo opened this issue Jun 25, 2024 · 0 comments
Open

My dream spec text #105

nicolo-ribaudo opened this issue Jun 25, 2024 · 0 comments

Comments

@nicolo-ribaudo
Copy link
Member

I have been thinking for a while about how I would like our spec to look like one day. The bar for publishing the spec is much lower than what I'd like the spec text to be, but it'd be great if one day we could reach this rigor and clarity.

  • There should be some spec-level object/record, like ECMA-262 Records or WHATWG structs that represents a decoded source map
    • We should clearly define an algorithm to convert between JSON and this format. The algorithm doesn't need to be fast — it needs to be somewhat easy to understand and it's the source of truth for what the correct behavior is. Implementations can have their own faster algorithms, as long as they behave the same.
    • We should define the composition operation based on these records, i.e. compose(source map record, source map record) -> source map record
  • There should be algorithms that take a source code string, a source map record, and return various info about it:
    • "what does the location X:Y in the original code correspond to in the running code?"
    • "what variables are visible from location X:Y in the original code?"
    • "what code do I need to run to get, from location X:Y, the value of the original variable foo"?
    • "what is the stack trace ... when remapped to the original code?"
  • We should properly reuse other web specs when discussing common web operations. We currently do this for fetching source maps, but we should also for example do it in resolving sources

I might have more ideas, and I will create individual issues once I think it's time to start going through them. I don't think any of these are blockers for publishing our first version.

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

1 participant