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

perf: avoid sourcemap chains during dev #8796

Merged
merged 8 commits into from
Jun 26, 2022
Merged

Conversation

patak-dev
Copy link
Member

Description

Fixes a perf regression @yyx990803 found introduced by:

Internal Plugins using transformStableResult needs to avoid modifying the line structure of the code, as sourcemaps generation during dev is skipped.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@netlify
Copy link

netlify bot commented Jun 26, 2022

Deploy Preview for vite-docs-main canceled.

Name Link
🔨 Latest commit cc262d9
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62b85a518a9c860008e07e11

@sapphi-red sapphi-red added the p4-important Violate documented behavior or significantly improves performance (priority) label Jun 26, 2022
@patak-dev patak-dev added this to the 3.0 milestone Jun 26, 2022
@poyoho poyoho force-pushed the fix/dev-sourcemap-generation branch from 6d8cf6f to 1596f42 Compare June 26, 2022 11:54
poyoho
poyoho previously approved these changes Jun 26, 2022
poyoho
poyoho previously approved these changes Jun 26, 2022
@patak-dev patak-dev changed the title perf: avoid sourcemap generation during dev for line-stable transforms perf: avoid sourcemap chains during dev Jun 26, 2022
@patak-dev patak-dev merged commit 1566f61 into main Jun 26, 2022
@patak-dev patak-dev deleted the fix/dev-sourcemap-generation branch June 26, 2022 13:41
@patak-dev
Copy link
Member Author

For reference: the idea is that Vite takes care of keeping the line structure of sources during the transpilation by different plugins stable. By doing so, it isn't necessary to do a chain of source maps, with a new one on each plugin. Some affected lines may end up with the column mapping for a given line wrong, but it is a fair price to pay for having the dev server run twice as fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants