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

Simplify invalidateOnFileChange() in Transformers #9379

Merged

Conversation

grishy
Copy link
Contributor

@grishy grishy commented Nov 12, 2023

↪️ Pull Request

In docs/code:

invalidateOnFileChange(FilePath): void

You don't need to add await before

💻 Examples

🚨 Test instructions

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@mischnic
Copy link
Member

There's actually one more case here which could just be a for loop without any Promises:

await Promise.all(
res.messages.map(({type, file: filePath}) => {
if (type === 'dependency') {
return asset.invalidateOnFileChange(filePath);
}
return Promise.resolve();
}),
);

@grishy
Copy link
Contributor Author

grishy commented Nov 12, 2023

Oh, I see. I will update it, if you want in this PR.

@grishy grishy changed the title Remove await from invalidateOnFileChange call Simplify invalidateOnFileChange() in Transformers Nov 12, 2023
Copy link
Member

@mischnic mischnic left a comment

Choose a reason for hiding this comment

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

Thanks!

@mischnic mischnic merged commit c88116a into parcel-bundler:v2 Nov 13, 2023
13 of 15 checks passed
@alshdavid alshdavid mentioned this pull request Nov 13, 2023
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

2 participants