Use globally accessible (rather than local) source paths in JS source maps (#781)#783
Merged
Conversation
Member
|
@djneades thanks a lot. Btw, Cats-Effect probably needs the same treatment 🙂 |
Contributor
Author
|
@alexandru You’re welcome. And yes, it probably does :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@alexandru Please see what you think of this. I have not previously encountered the sbt-git plugin that the Monix build is using. I am also not sure of your versioning policies and preferences, but I have attempted to do something reasonably sensible along the lines of the Cats project as a first attempt at a PR.
I have tested this change (by running
sbt packagefor themonixproject) in three scenarios:When the HEAD of the local build repository is tagged with a version string. In this case, source maps reference appropriate tagged content on GitHub. e.g.
https://raw.githubusercontent.com/monix/monix/v3.0.0-RC2/...When there are uncommitted changes in the local build repository (in which case,
isSnapshotappears to betrue). In this scenario, source maps reference the SHA hash of the most recent commit. i.e.https://raw.githubusercontent.com/monix/monix/<sha-hash>/...When there are committed but untagged changes. In this case,
isSnapshotappears to be false, and the source maps reference the most recent tag that sbt-git was able to find.Scenario (1) is probably all that most Monix users will care about, with (2) and (3) being of relevance to Monix developers.
It seems to me that the behaviour in scenario (3) is not ideal – it would probably be better to map to GitHub paths containing the SHA hash of the current commit. However, it is not clear to me whether it is the
isSnapshotlogic that is incorrect here – perhapsisSnapshotshould be true in this instance? This will depend upon your definition of snapshot for the Monix project.Finally, the behaviour of scenario (2) is also debatable. Maybe local paths should be preserved in this situation? Again, though, I’m unsure whether
isSnapshotis acting correctly here – are we really building a snapshot if we are building from uncommitted changes? Given my lack of familiarity with sbt-git and your project policies, I am not sure how best to detect this situation.Thus, I suspect this PR will need further work, and that it would make more sense for a regular Monix contributor to run with that given the policy questions involved. Still, perhaps this PR will be somewhat helpful as a starting point.