Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(worker): inline es worker does not work in build mode #14307

Merged
merged 5 commits into from
Sep 15, 2023

Conversation

Gaubee
Copy link
Contributor

@Gaubee Gaubee commented Sep 6, 2023

Description

  1. new Worker(blobUrl,{type:'module'/*missed*/}) It should be configured as expected (fix:Inline Web Worker with format:es(type=module) does not work as expected in build mode #14306)
  2. inline esmodule web worker should not revokeObjectURL immediately

Additional context


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 PR Title 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.

@stackblitz
Copy link

stackblitz bot commented Sep 6, 2023

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

@Gaubee Gaubee changed the title fix Web Worker with format:es does not work as expected in build mode (fix:#14306) fix(vite): Inline web-worker with format:es does not work as expected in build mode Sep 6, 2023
@Gaubee Gaubee changed the title fix(vite): Inline web-worker with format:es does not work as expected in build mode fix(vite): inline web-worker with format:es does not work as expected in build mode Sep 6, 2023
@Gaubee
Copy link
Contributor Author

Gaubee commented Sep 6, 2023

why the CI / Build&Test: node-20, ubuntu-latest (pull_request) fail? what can I do for it?

@sapphi-red
Copy link
Member

why the CI / Build&Test: node-20, ubuntu-latest (pull_request) fail? what can I do for it?

It seems to be a bug in Node: nodejs/node#49497
You can ignore it for now.

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) feat: web workers labels Sep 6, 2023
@sapphi-red sapphi-red changed the title fix(vite): inline web-worker with format:es does not work as expected in build mode fix(worker): inline es worker does not work in build mode Sep 6, 2023
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.

Would you add a test in playground/worker?
I guess changing my-worker.ts and es-worker.spec.ts would work.

@Gaubee
Copy link
Contributor Author

Gaubee commented Sep 13, 2023

Would you add a test in playground/worker? I guess changing my-worker.ts and es-worker.spec.ts would work.

the tests added

@sapphi-red
Copy link
Member

I rebased the branch and force-pushed as the diff view was huge.

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.

Thanks!

@sapphi-red sapphi-red merged commit 7371c5c into vitejs:main Sep 15, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feat: web workers p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline Web Worker with format:es(type=module) does not work as expected in build mode
3 participants