Skip to content

fix: avoid using Promise.allSettled in preload function #19805

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

Merged
merged 7 commits into from
Apr 16, 2025

Conversation

novlan1
Copy link
Contributor

@novlan1 novlan1 commented Apr 7, 2025

Description

Add polyfill of Promise.allSettled. In some legacy browser.

@sapphi-red sapphi-red changed the title fix(allsetttled-polyfill): add polyfill of Promise.allSettled fix: avoid using Promise.allSettled in preload function Apr 8, 2025
@sapphi-red sapphi-red added has workaround p2-edge-case Bug, but has workaround or limited in scope (priority) labels Apr 8, 2025
sapphi-red
sapphi-red previously approved these changes Apr 8, 2025
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

I think we can have this change.

We do say "Vite does not cover polyfills." here. But for code generated by Vite, I think it would be more friendly for users if it doesn't require polyfills.
https://vite.dev/guide/build.html#browser-compatibility

If we go this way, we should ensure the code generated by Vite only uses features that are supported by the minimum browser support ranges. It fully supports ES2017 and partially supports ES2018.

@github-project-automation github-project-automation bot moved this to Discussing in Team Board Apr 8, 2025
@novlan1
Copy link
Contributor Author

novlan1 commented Apr 8, 2025

Thanks. @sapphi-red

@novlan1
Copy link
Contributor Author

novlan1 commented Apr 11, 2025

@sapphi-red Sorry to bother you. But when will this pr be merged? When will it release?

@patak-dev
Copy link
Member

Hey @novlan1, we don't have a definite time to merge PRs and do releases. To avoid being blocked by vite release process or any other project, you can patch the package to use the PR. See pnpm patch for example https://pnpm.io/cli/patch

@novlan1
Copy link
Contributor Author

novlan1 commented Apr 11, 2025

Hey @novlan1, we don't have a definite time to merge PRs and do releases. To avoid being blocked by vite release process or any other project, you can patch the package to use the PR. See pnpm patch for example https://pnpm.io/cli/patch

Got it! Thank you.

@sapphi-red sapphi-red moved this from Discussing to Approved in Team Board Apr 16, 2025
@sapphi-red sapphi-red merged commit 35c7f35 into vitejs:main Apr 16, 2025
15 checks passed
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Apr 17, 2025
| datasource | package | from  | to    |
| ---------- | ------- | ----- | ----- |
| npm        | vite    | 6.2.1 | 6.3.1 |


## [v6.3.1](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small631-2025-04-17-small)

-   fix: avoid using `Promise.allSettled` in preload function ([#19805](vitejs/vite#19805)) ([35c7f35](vitejs/vite@35c7f35)), closes [#19805](vitejs/vite#19805)
-   fix: backward compat for internal plugin `transform` calls ([#19878](vitejs/vite#19878)) ([a152b7c](vitejs/vite@a152b7c)), closes [#19878](vitejs/vite#19878)


## [v6.3.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#630-2025-04-16)

-   fix(hmr): avoid infinite loop happening with `hot.invalidate` in circular deps ([#19870](vitejs/vite#19870)) ([d4ee5e8](vitejs/vite@d4ee5e8)), closes [#19870](vitejs/vite#19870)
-   fix(preview): use host url to open browser ([#19836](vitejs/vite#19836)) ([5003434](vitejs/vite@5003434)), closes [#19836](vitejs/vite#19836)


## [v6.2.6](https://github.com/vitejs/vite/releases/tag/v6.2.6)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.6/packages/vite/CHANGELOG.md) for details.


## [v6.2.5](https://github.com/vitejs/vite/releases/tag/v6.2.5)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.5/packages/vite/CHANGELOG.md) for details.


## [v6.2.4](https://github.com/vitejs/vite/releases/tag/v6.2.4)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.4/packages/vite/CHANGELOG.md) for details.


## [v6.2.3](https://github.com/vitejs/vite/releases/tag/v6.2.3)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.3/packages/vite/CHANGELOG.md) for details.


## [v6.2.2](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small622-2025-03-14-small)

-   fix: await client buildStart on top level buildStart ([#19624](vitejs/vite#19624)) ([b31faab](vitejs/vite@b31faab)), closes [#19624](vitejs/vite#19624)
-   fix(css): inline css correctly for double quote use strict ([#19590](vitejs/vite#19590)) ([d0aa833](vitejs/vite@d0aa833)), closes [#19590](vitejs/vite#19590)
-   fix(deps): update all non-major dependencies ([#19613](vitejs/vite#19613)) ([363d691](vitejs/vite@363d691)), closes [#19613](vitejs/vite#19613)
-   fix(indexHtml): ensure correct URL when querying module graph ([#19601](vitejs/vite#19601)) ([dc5395a](vitejs/vite@dc5395a)), closes [#19601](vitejs/vite#19601)
-   fix(preview): use preview https config, not server ([#19633](vitejs/vite#19633)) ([98b3160](vitejs/vite@98b3160)), closes [#19633](vitejs/vite#19633)
-   fix(ssr): use optional chaining to prevent "undefined is not an object" happening in \`ssrRewriteStac ([4309755](vitejs/vite@4309755)), closes [#19612](vitejs/vite#19612)
-   feat: show friendly error for malformed `base` ([#19616](vitejs/vite#19616)) ([2476391](vitejs/vite@2476391)), closes [#19616](vitejs/vite#19616)
-   feat(worker): show asset filename conflict warning ([#19591](vitejs/vite#19591)) ([367d968](vitejs/vite@367d968)), closes [#19591](vitejs/vite#19591)
-   chore: extend commit hash correctly when ambigious with a non-commit object ([#19600](vitejs/vite#19600)) ([89a6287](vitejs/vite@89a6287)), closes [#19600](vitejs/vite#19600)
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Apr 17, 2025
| datasource | package | from  | to    |
| ---------- | ------- | ----- | ----- |
| npm        | vite    | 6.2.1 | 6.3.1 |


## [v6.3.1](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small631-2025-04-17-small)

-   fix: avoid using `Promise.allSettled` in preload function ([#19805](vitejs/vite#19805)) ([35c7f35](vitejs/vite@35c7f35)), closes [#19805](vitejs/vite#19805)
-   fix: backward compat for internal plugin `transform` calls ([#19878](vitejs/vite#19878)) ([a152b7c](vitejs/vite@a152b7c)), closes [#19878](vitejs/vite#19878)


## [v6.3.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#630-2025-04-16)

-   fix(hmr): avoid infinite loop happening with `hot.invalidate` in circular deps ([#19870](vitejs/vite#19870)) ([d4ee5e8](vitejs/vite@d4ee5e8)), closes [#19870](vitejs/vite#19870)
-   fix(preview): use host url to open browser ([#19836](vitejs/vite#19836)) ([5003434](vitejs/vite@5003434)), closes [#19836](vitejs/vite#19836)


## [v6.2.6](https://github.com/vitejs/vite/releases/tag/v6.2.6)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.6/packages/vite/CHANGELOG.md) for details.


## [v6.2.5](https://github.com/vitejs/vite/releases/tag/v6.2.5)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.5/packages/vite/CHANGELOG.md) for details.


## [v6.2.4](https://github.com/vitejs/vite/releases/tag/v6.2.4)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.4/packages/vite/CHANGELOG.md) for details.


## [v6.2.3](https://github.com/vitejs/vite/releases/tag/v6.2.3)

Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v6.2.3/packages/vite/CHANGELOG.md) for details.


## [v6.2.2](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small622-2025-03-14-small)

-   fix: await client buildStart on top level buildStart ([#19624](vitejs/vite#19624)) ([b31faab](vitejs/vite@b31faab)), closes [#19624](vitejs/vite#19624)
-   fix(css): inline css correctly for double quote use strict ([#19590](vitejs/vite#19590)) ([d0aa833](vitejs/vite@d0aa833)), closes [#19590](vitejs/vite#19590)
-   fix(deps): update all non-major dependencies ([#19613](vitejs/vite#19613)) ([363d691](vitejs/vite@363d691)), closes [#19613](vitejs/vite#19613)
-   fix(indexHtml): ensure correct URL when querying module graph ([#19601](vitejs/vite#19601)) ([dc5395a](vitejs/vite@dc5395a)), closes [#19601](vitejs/vite#19601)
-   fix(preview): use preview https config, not server ([#19633](vitejs/vite#19633)) ([98b3160](vitejs/vite@98b3160)), closes [#19633](vitejs/vite#19633)
-   fix(ssr): use optional chaining to prevent "undefined is not an object" happening in \`ssrRewriteStac ([4309755](vitejs/vite@4309755)), closes [#19612](vitejs/vite#19612)
-   feat: show friendly error for malformed `base` ([#19616](vitejs/vite#19616)) ([2476391](vitejs/vite@2476391)), closes [#19616](vitejs/vite#19616)
-   feat(worker): show asset filename conflict warning ([#19591](vitejs/vite#19591)) ([367d968](vitejs/vite@367d968)), closes [#19591](vitejs/vite#19591)
-   chore: extend commit hash correctly when ambigious with a non-commit object ([#19600](vitejs/vite#19600)) ([89a6287](vitejs/vite@89a6287)), closes [#19600](vitejs/vite#19600)
@isnifer
Copy link

isnifer commented Apr 17, 2025

Wow, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has workaround p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

4 participants