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(transformRequest): fast-path watch and sourcemap handling #16170

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Mar 15, 2024

Description

  1. Skip ensureWatchedFile if the file failed to load from the fs.
  2. Skip removing the sourcemap comment from files if we found there's no sourcemap early on.
  3. Improves sourcemap error message. (Users were having trouble with it in the past: Failed to load source map for /node_modules/.vite/vite.js #6981 and can't read sourcemap file #10172)

Additional context

I found these while trying to make this.load also work for files in the filesystem (#16018 (comment)), I needed to share some code from transformRequest.ts to pluginContainer.ts. But this PR applies to refactors first so it's easier to review.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Mar 15, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@bluwy bluwy added the p2-nice-to-have Not breaking anything but nice to have (priority) label Mar 15, 2024
@sapphi-red
Copy link
Member

I found these while trying to make this.load also work for files in the filesystem (#16018 (comment)), I needed to share some code from transformRequest.ts to pluginContainer.ts.

I thought about that while creating #14953, too. 🙂

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

@patak-dev patak-dev merged commit de60f1e into main Mar 17, 2024
10 checks passed
@patak-dev patak-dev deleted the perf-transform-request branch March 17, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants