Skip to content

feat: single cancellable scan#11243

Closed
dominikg wants to merge 2 commits intovitejs:mainfrom
dominikg:refactor/single-cancellable-scan
Closed

feat: single cancellable scan#11243
dominikg wants to merge 2 commits intovitejs:mainfrom
dominikg:refactor/single-cancellable-scan

Conversation

@dominikg
Copy link
Contributor

@dominikg dominikg commented Dec 7, 2022

Description

scanning currently starts multiple esbuild promises and there is no way to cancel them.

use a single pass promise and add a plugin that cancels the running build when calling cancel()

Additional context

this may be useful to prevent parallel runs of the optimizer too, ideally there was a simpler way to cancel the esbuild promise but i didn't see it :/


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.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • 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).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@dominikg
Copy link
Contributor Author

dominikg commented Dec 7, 2022

see #11245 for this without cancel.

@benmccann
Copy link
Collaborator

I filed a feature request: evanw/esbuild#2725

@sapphi-red sapphi-red mentioned this pull request Feb 2, 2023
9 tasks
@benmccann benmccann removed the on hold label Feb 27, 2023
@benmccann
Copy link
Collaborator

@dominikg perhaps you'd be able to rebase this PR?

esbuild added support for cancel in 0.17.1: https://github.com/evanw/esbuild/releases/tag/v0.17.1

vite now uses esbuild@0.17.5

@IanVS
Copy link
Contributor

IanVS commented Feb 27, 2023

I wonder if this might help solve #9986. That sure would be nice! It's a big frustration for a lot of Storybook-vite users.

@dominikg
Copy link
Contributor Author

not sure if rebase is a good idea, this PR has extra complexity that's no longer needed with the new esbuild api.

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.

4 participants