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(sourcemap): enable rfc-3986 urls #3100

Merged
merged 5 commits into from
Oct 11, 2021
Merged

feat(sourcemap): enable rfc-3986 urls #3100

merged 5 commits into from
Oct 11, 2021

Conversation

rwaskiewicz
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Unit tests (npm test) were run locally and passed
  • E2E Tests (npm run test.karma.prod) were run locally and passed
  • Prettier (npm run prettier) was run locally and passed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Today, sourcemap urls generated by Stencil work, but are not compliant with the sourcemap spec

GitHub Issue Number: N/A

What is the new behavior?

ensure that sourceMapUrls are compliant with RFC-3986, per the sourcemap
specification:

Note: is a URL as defined in RFC3986; in particular, characters
outside the set permitted to appear in URIs must be percent-encoded.

STENCIL-173: Make sourceMapUrl values RFC 3986 compliant

Does this introduce a breaking change?

  • Yes
  • No - I suppose one could interpret it as such in a way though....

Testing

https://github.com/rwaskiewicz/stencil-sourcemap-rfc3986/commits/main demonstrates how I tested this. Looking through the history of that repro:

I then ran npm start and validated that sourcemaps look a-okay:

Screen Shot 2021-10-11 at 8 45 49 AM

Screen Shot 2021-10-11 at 8 47 52 AM

Oh, and this is unit tested as well 🙂

Other information

ensure that sourceMapUrls are compliant with RFC-3986, per the sourcemap
[specification](https://sourcemaps.info/spec.html#h.crcf4lqeivt8).
Specifically:

> Note: <url> is a URL as defined in RFC3986; in particular, characters
outside the set permitted to appear in URIs must be percent-encoded.

STENCIL-173: Make sourceMapUrl values RFC 3986 compliant
@rwaskiewicz rwaskiewicz marked this pull request as ready for review October 11, 2021 12:59
@rwaskiewicz rwaskiewicz requested a review from a team October 11, 2021 12:59
@rwaskiewicz rwaskiewicz merged commit 4b2018a into main Oct 11, 2021
@rwaskiewicz rwaskiewicz deleted the sourcemaps/rfc3986 branch October 11, 2021 18:03
rwaskiewicz added a commit that referenced this pull request Dec 1, 2021
this commit fixes a regression originally introduced in #3100, where
inline sourcemaps that are data URI's are erroneously encoded using
RFC-3986. this causes the sourcemaps for tests to not correctly map the
transpiled output back to the original source code.
rwaskiewicz added a commit that referenced this pull request Dec 2, 2021
this commit fixes a regression originally introduced in #3100, where
inline sourcemaps that are data URI's are erroneously encoded using
RFC-3986. this causes the sourcemaps for tests to not correctly map the
transpiled output back to the original source code.
rwaskiewicz added a commit that referenced this pull request Dec 3, 2021
this commit fixes a regression originally introduced in #3100, where
inline sourcemaps that are data URI's are erroneously encoded using
RFC-3986. this causes the sourcemaps for tests to not correctly map the
transpiled output back to the original source code.
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.

3 participants