Skip to content

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
@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

github-merge-queue bot pushed a commit to rolldown/rolldown that referenced this pull request Dec 1, 2024
<!-- Thank you for contributing! -->

### Description

This PR ports `hires: "boundary"` option from magic-string
- Rich-Harris/magic-string#255
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