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

Add new API to get source paths used by the generated sourcemap #5

Open
mtolmacs opened this issue Apr 19, 2023 · 0 comments
Open

Add new API to get source paths used by the generated sourcemap #5

mtolmacs opened this issue Apr 19, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mtolmacs
Copy link
Owner

Background

When the browser can't find the source file in the sourcesContent field (i.e. it's null), it tries to load it from the same base url it downloaded the sourcemap from.

Currently only the sourcemap JSON can be extracted from the lib via its public API. However having access to the list of sources on the implementor side can be used to dynamically serve the files when requested by the browser.

API

Add new instance method to WASM with the following signature

pub fn get_sources(&self) -> Vec<String> {}

Note: The returned Vec not necessarily contains valid paths, so the String type is chosen here. It should be the responsibility of the implementor to resolve these fragments to actual file paths.

Success

  • The proposed new method can be called on a WASM instance
  • There is at least one test case covering this new method
@mtolmacs mtolmacs added enhancement New feature or request good first issue Good for newcomers labels Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant