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: hires boundary #255

Merged
merged 1 commit into from Jul 28, 2023
Merged

feat: hires boundary #255

merged 1 commit into from Jul 28, 2023

Conversation

bluwy
Copy link
Contributor

@bluwy bluwy commented Jul 27, 2023

hires: 'boundary' generates a segment for each word boundary, instead of for each character. Which should help:

  • Reduce sourcemap size
  • Easier to find original position in mappings
  • Faster sourcemap merging

From twitter idea: https://twitter.com/dummdidumm_/status/1674102437890621454

Example sourcemap visualization

* If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here.
*/
hires?: boolean;
hires?: boolean | 'boundary';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe word-boundary to be more specific? Not sure if we are going to have more different type of boundary tho

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking a shorter name would make it easier to type out when using it. But open to other names too.

@antfu antfu merged commit a63d5f2 into Rich-Harris:master Jul 28, 2023
12 checks passed
@bluwy bluwy deleted the hires-boundary branch July 28, 2023 03:38
JoostK added a commit to JoostK/angular-cli that referenced this pull request Aug 6, 2023
… to word boundary

magic-string 0.30.2 introduced [the `boundary` strategy][1] for its high-resolution
source map mode, reducing the number of source map segments to align with word
boundaries instead of having a segment per character.

[1]: Rich-Harris/magic-string#255
dgp1130 pushed a commit to angular/angular-cli that referenced this pull request Aug 9, 2023
… to word boundary

magic-string 0.30.2 introduced [the `boundary` strategy][1] for its high-resolution
source map mode, reducing the number of source map segments to align with word
boundaries instead of having a segment per character.

[1]: Rich-Harris/magic-string#255
@lforst
Copy link

lforst commented Apr 2, 2024

This PR is the next best thing since sliced bread. <3

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.

None yet

3 participants