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

feat(reporter): improve source map handling and reporting. #2149

Merged
merged 1 commit into from
May 25, 2016

Conversation

mprobst
Copy link
Contributor

@mprobst mprobst commented May 25, 2016

  • Avoid prepending basepath to every file path.
    The original path is usually relative to the project, and much more meaningful
    than basepath + path, which is usually a long, absolute path.
  • Format as [mapped location] <- [original location]
    The mapped location is the more important part for users, it's the source
    file they are working on.
  • Resolve source map file paths relative to the original file path.
    It's common for tools that generate a source map to not have a complete
    understanding of what paths they should generate, in which case they just use
    the local path. An example tool is TypeScript.
    Resolving the path against the original file path makes these paths
    unambiguous in the project.

@mprobst
Copy link
Contributor Author

mprobst commented May 25, 2016

@zzo PTAL

@maksimr
Copy link
Contributor

maksimr commented May 25, 2016

@mprobst thanks for PR

Please look at failed tests - https://ci.appveyor.com/project/dignifiedquire/karma/build/296/job/0ukhlfgwcm548tjg

- Avoid prepending basepath to every file path.
  The original path is usually relative to the project, and much more meaningful
  than basepath + path, which is usually a long, absolute path.
- Format as [mapped location] <- [original location]
  The mapped location is the more important part for users, it's the source
  file they are working on.
- Resolve source map file paths relative to the original file path.
  It's common for tools that generate a source map to not have a complete
  understanding of what paths they should generate, in which case they just use
  the local path. An example tool is TypeScript.
  Resolving the path against the original file path makes these paths
  unambiguous in the project.
@mprobst
Copy link
Contributor Author

mprobst commented May 25, 2016

@maksimr @dignifiedquire Thanks for looking into this! I fixed the test failure (grumble grumble windows grumble).

@zzo
Copy link
Contributor

zzo commented May 25, 2016

thanks martin looks good

@dignifiedquire
Copy link
Member

Thanks :octocat: sourcemaps can always use more love

@dignifiedquire dignifiedquire merged commit 13368e6 into karma-runner:master May 25, 2016
@mprobst mprobst deleted the source-map-fixes branch May 25, 2016 21:05
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

Successfully merging this pull request may close these issues.

4 participants