Skip to content

worker: add ESM version examples to worker docs - #57645

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
fisker:worker_threads-esm-doc
Apr 19, 2025
Merged

worker: add ESM version examples to worker docs#57645
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
fisker:worker_threads-esm-doc

Conversation

@fisker

Copy link
Copy Markdown
Contributor
  • 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-botnodejs-github-bot added doc Issues and PRs related to the documentations. worker Issues and PRs related to Worker support. labels Mar 27, 2025
Comment threaddoc/api/worker_threads.md Outdated

Copy link
Copy Markdown
ContributorAuthor

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.

@fiskerfisker changed the title docs: add ESM version examples to worker_threads docsdocs(worker_threads): add ESM version examples to worker_threads docsMar 27, 2025
@fiskerfisker changed the title docs(worker_threads): add ESM version examples to worker_threads docsdocs(worker): add ESM version examples to worker_threads docsMar 27, 2025
@fisker
fiskerforce-pushed the worker_threads-esm-doc branch from 6d41acc to e1eda74CompareMarch 27, 2025 10:56
@fiskerfisker changed the title docs(worker): add ESM version examples to worker_threads docsdocs(worker): add ESM version examples to worker docsMar 27, 2025
@fisker
fiskerforce-pushed the worker_threads-esm-doc branch from e1eda74 to 132b6bfCompareMarch 27, 2025 11:01
@fiskerfisker changed the title docs(worker): add ESM version examples to worker docsdocs: worker: add ESM version examples to worker docsMar 27, 2025
@fisker
fiskerforce-pushed the worker_threads-esm-doc branch from 132b6bf to c9a76b5CompareMarch 27, 2025 11:09
@fiskerfisker changed the title docs: worker: add ESM version examples to worker docsworker: add ESM version examples to worker docsMar 27, 2025
@fisker
fisker marked this pull request as ready for review March 28, 2025 07:25
@fisker
fiskerforce-pushed the worker_threads-esm-doc branch from c9a76b5 to 328cb9aCompareApril 8, 2025 15:53
@lpincalpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 19, 2025
@nodejs-github-botnodejs-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:mainApr 19, 2025
@nodejs-github-bot

Copy link
Copy Markdown
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 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>
@ghostghost mentioned this pull request Jun 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.workerIssues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@fisker@nodejs-github-bot@lpinca