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 groundwork for source map support #715

Merged
merged 29 commits into from
Jul 5, 2021
Merged

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Jun 28, 2021

This PR adds a bit of groundwork for supporting source maps in WMR. There is lots more work to do, but this is a complete enough start ready to be merged and to build upon.

  • Fix plugin container not forwarding source maps
  • Fix invalid null value in sources array of source maps
  • Fix .map files not being served
  • Fix options.sourcemap not passed to plugins
  • Fix options.sourcemap always being false
  • Skip transform in import-assertion plugin when no changes were made.
  • Merge source maps in transform step
  • Update plugins to return source maps when they transform the code

Fixes #699

@changeset-bot
Copy link

changeset-bot bot commented Jun 28, 2021

🦋 Changeset detected

Latest commit: e093373

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wmr Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@marvinhagemeister marvinhagemeister changed the title Fix source maps not being served Add groundwork for source map support Jun 28, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2021

Size Change: +1.55 kB (0%)

Total Size: 763 kB

Filename Size Change
packages/wmr/wmr.cjs 727 kB +1.55 kB (0%)
ℹ️ View Unchanged
Filename Size
examples/demo/dist/about/index.html 713 B
examples/demo/dist/alias-outside/index.html 692 B
examples/demo/dist/assets/Calendar.********.css 702 B
examples/demo/dist/assets/style.********.css 624 B
examples/demo/dist/chunks/alias-outside.********.js 138 B
examples/demo/dist/chunks/class-fields.********.js 212 B
examples/demo/dist/chunks/compat.********.js 15.3 kB
examples/demo/dist/chunks/hoofd.module.********.js 1.46 kB
examples/demo/dist/chunks/index.********.js 267 B
examples/demo/dist/chunks/json.********.js 239 B
examples/demo/dist/chunks/meta-tags.********.js 299 B
examples/demo/dist/chunks/prerender.********.js 293 B
examples/demo/dist/class-fields/index.html 703 B
examples/demo/dist/compat/index.html 1.55 kB
examples/demo/dist/env/index.html 779 B
examples/demo/dist/error/index.html 708 B
examples/demo/dist/files/index.html 741 B
examples/demo/dist/index.********.js 7.65 kB
examples/demo/dist/index.html 767 B
examples/demo/dist/json/index.html 711 B
examples/demo/dist/lazy-and-late/index.html 714 B
examples/demo/dist/meta-tags/index.html 778 B

compressed-size-action

@marvinhagemeister
Copy link
Member Author

Currently waiting on Rich-Harris/sourcemap-codec#85 to be merged and released. It's the reason our CI is failing here.

@marvinhagemeister marvinhagemeister force-pushed the sourcmap-infra branch 2 times, most recently from c876fb8 to 5119f77 Compare July 5, 2021 06:52
@marvinhagemeister
Copy link
Member Author

Alright, used patch-package to patch sourcemap-codec and es-module-lexer locally to support native ESM in node 12.18 and make our CI green again. Filed upstream PRs for both packages. Once they are merged and released we can easily drop our floating patches without hassle.

@marvinhagemeister marvinhagemeister merged commit dc481b1 into main Jul 5, 2021
@marvinhagemeister marvinhagemeister deleted the sourcmap-infra branch July 5, 2021 11:59
@github-actions github-actions bot mentioned this pull request Jul 5, 2021
marvinhagemeister added a commit that referenced this pull request Jul 5, 2021
This was introduced in #715 by a wrong `String.prototype.replace´ to a
`while` loop conversion.
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.

Improve source map handling
1 participant