Skip to content

[dev] display source mapped line numbers #1315

@EverlastingBugstopper

Description

@EverlastingBugstopper

@xtuc has a WIP PR that would add sourcemaps to anything published with wrangler. we should utilize these maps in wrangler dev. @xtuc has already implemented source maps in the devtools protocol - the source map is accessible as base64 encoded json

Possible implementations

  • Implement in the runtime
    • JavaScript implementation
      • probably easier
    • C++/KJ implementation
      • possibly more performant

@xtuc would need to talk with runtime team about how we would possibly move forward with this approach. He noted a possible concern with regards to leaking meaningful stack traces in response bodies.

  • Implement everything in Wrangler
    • could parse base64 sourcemap from devtools and compute accurate line numbers from lineNumber and columnNumber fields from devtools
    • alternatively could read in source map from webpack config and not worry about base64 and compute accurate line numbers from lineNumber and columnNumber fields from devtools protocol

This approach is probably the easiest but would require any new clients to also implement their own source map handling approach. My guess is that long term we probably want the runtime to support this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions