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

worker_threads: add support for data: URLs #34584

Closed
wants to merge 2 commits into from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jul 31, 2020

This PR adds support for data URLs using the same implementation provided by the ESM implementation. This covers the use case of a user wanting to use eval in a worker thread with ESM syntax.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Jul 31, 2020
@jasnell jasnell added whatwg-url Issues and PRs related to the WHATWG URL implementation. worker Issues and PRs related to Worker support. labels Jul 31, 2020
@jasnell jasnell requested a review from addaleax July 31, 2020 21:55
@addaleax
Copy link
Member

addaleax commented Aug 1, 2020

@nodejs/modules-active-members

@addaleax addaleax added the esm Issues and PRs related to the ECMAScript Modules implementation. label Aug 1, 2020
doc/api/worker_threads.md Outdated Show resolved Hide resolved
Copy link
Member

@bmeck bmeck left a comment

Choose a reason for hiding this comment

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

minor nits, but seems like a good PR

lib/internal/worker.js Outdated Show resolved Hide resolved
lib/internal/worker.js Outdated Show resolved Hide resolved
@Trott
Copy link
Member

Trott commented Aug 11, 2020

Rebased against master, resolved conflicts, force-pushed. PTAL

@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 11, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 11, 2020
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor Author

aduh95 commented Aug 11, 2020

@Trott I had originally split the PR in two commits, one for the change in the evalModule signature (0268ed72d894970f6a0011fd6bfa8203d42db0fe), one to actually add support for the data: URLs (28eedafd6a78d95f9860c78aa4f77e191a026e99). If we want to squash into one commit, I think the commit message should be taken from the latter rather than the former. What are your thoughts?

EDIT: turned out 0268ed72d894970f6a0011fd6bfa8203d42db0fe is no longer necessary thanks to e948ef3. I've removed it in my last force push.

@Trott
Copy link
Member

Trott commented Aug 12, 2020

@Trott I had originally split the PR in two commits, one for the change in the evalModule signature (0268ed7), one to actually add support for the data: URLs (28eedaf). If we want to squash into one commit, I think the commit message should be taken from the latter rather than the former. What are your thoughts?

Works for me. Want to make the change and force-push? Sorry I squashed when perhaps I shouldn't have. Feel free to split it back into two commits, if that's what you prefer and if it's not a big hassle.

@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 17, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 17, 2020
@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Aug 17, 2020

Possibly related error in CI? Same test failed on two platforms

@aduh95
Copy link
Contributor Author

aduh95 commented Aug 17, 2020

Jenkins is a bit confusing to me, which test do you say is failing? From what I can see, there are two:

Again, this is a bit obscure to me, but they don't look related to this PR.

@jasnell
Copy link
Member

jasnell commented Aug 17, 2020

Heh, you're right, there are two separate ones. I likely ended up looking at the same results twice. Either way, we just need a quick confirmation that they are unrelated and to run them again to doublecheck. They might be flaky tests.

@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Aug 19, 2020

CI still unfortunately flaky. Running again

@aduh95
Copy link
Contributor Author

aduh95 commented Aug 19, 2020

jasnell pushed a commit that referenced this pull request Aug 19, 2020
PR-URL: #34584
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
@jasnell
Copy link
Member

jasnell commented Aug 19, 2020

Landed in ffa5b06

@jasnell jasnell closed this Aug 19, 2020
BethGriggs pushed a commit that referenced this pull request Aug 20, 2020
PR-URL: #34584
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
@danielleadams danielleadams mentioned this pull request Aug 20, 2020
BethGriggs pushed a commit that referenced this pull request Aug 20, 2020
PR-URL: #34584
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
@addaleax addaleax added semver-minor PRs that contain new features and should be released in the next minor version. backport-blocked-v12.x labels Sep 21, 2020
@aduh95 aduh95 deleted the worker-data-url-support branch November 27, 2020 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. esm Issues and PRs related to the ECMAScript Modules implementation. lib / src Issues and PRs related to general changes in the lib or src directory. semver-minor PRs that contain new features and should be released in the next minor version. whatwg-url Issues and PRs related to the WHATWG URL implementation. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants