Skip to content

worker: add ESM version examples to worker docs #57645

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 1 commit into from
Apr 19, 2025

Conversation

fisker
Copy link
Contributor

@fisker fisker commented Mar 27, 2025

  • Add ESM version to all examples
  • Add 'use strict' directive to all cjs blocks, doing this only because there are blocks includes them, better add it consistently
  • Change first argument to new Worker() in ESM version from url.fileURLToPath(import.meta.url) to new URL(import.meta.url)

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. worker Issues and PRs related to Worker support. labels Mar 27, 2025
parentPort.postMessage(parse(script));
}

export default function parseJSAsync(script) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ESM version can't conditional add exports like CJS, it should be fine to always add a export.

@fisker fisker changed the title docs: add ESM version examples to worker_threads docs docs(worker_threads): add ESM version examples to worker_threads docs Mar 27, 2025
@fisker fisker changed the title docs(worker_threads): add ESM version examples to worker_threads docs docs(worker): add ESM version examples to worker_threads docs Mar 27, 2025
@fisker fisker force-pushed the worker_threads-esm-doc branch from 6d41acc to e1eda74 Compare March 27, 2025 10:56
@fisker fisker changed the title docs(worker): add ESM version examples to worker_threads docs docs(worker): add ESM version examples to worker docs Mar 27, 2025
@fisker fisker force-pushed the worker_threads-esm-doc branch from e1eda74 to 132b6bf Compare March 27, 2025 11:01
@fisker fisker changed the title docs(worker): add ESM version examples to worker docs docs: worker: add ESM version examples to worker docs Mar 27, 2025
@fisker fisker force-pushed the worker_threads-esm-doc branch from 132b6bf to c9a76b5 Compare March 27, 2025 11:09
@fisker fisker changed the title docs: worker: add ESM version examples to worker docs worker: add ESM version examples to worker docs Mar 27, 2025
@fisker fisker marked this pull request as ready for review March 28, 2025 07:25
@fisker fisker force-pushed the worker_threads-esm-doc branch from c9a76b5 to 328cb9a Compare April 8, 2025 15:53
@lpinca lpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 19, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 19, 2025
@nodejs-github-bot nodejs-github-bot merged commit 0699a99 into nodejs:main Apr 19, 2025
18 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 0699a99

@fisker fisker deleted the worker_threads-esm-doc branch April 19, 2025 18:40
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 16, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 18, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request May 19, 2025
PR-URL: #57645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants