| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
I disagree with the changes in the test, we want to keep the test as is to ensure there's no regressions. The doc-changes LGTM.
Sorry, something went wrong.
What test change do you disagree with? |
Sorry, something went wrong.
Changing the tests to test globalThis.crypto instead of require('node:crypto').webcrypto. |
Sorry, something went wrong.
We have other existing tests that ensure the two are equal. So I don't see why these changes would be a cause for concern. |
Sorry, something went wrong.
That seems like another reason not to make this change. Unless we decide to deprecate require('node:crypto').webcrypto, there's no reason to remove it from our tests IMO. |
Sorry, something went wrong.
|
I'm unforunately not following your argumentation @aduh95. I don't see the need for having to have a deprecation on it to recognize the global is the likely way of accessing a Web API, it is the way we already have in most doc examples, and it should therefore be the one tested. |
Sorry, something went wrong.
|
I guess we would have to agree to disagree, and wait to see if someone else wants to chime in. If someone else thinks we should merge it, I'm ready to dismiss my review. Count me as -.5 on this because:
I disagree, the fact that one API is used less often than another doesn't mean it deserves less test coverage (but anyway it's a bit off-topic, since both APIs are equivalent in this case). |
Sorry, something went wrong.
There was a problem hiding this comment.
I agree with @aduh95 regarding the usage of require('node:crypto').webcrypto instead of globalThis.crypto internally.
I'm in favor of blocking this because, if we are going to use globalThis.crypto instead of require('node:crypto').webcrypto we need a lint rule to protect this change in the upcoming pull requests.
Sorry, something went wrong.
And I've requested assistance with such in the very description of this PR myself. |
Sorry, something went wrong.
I totally missed that part, my bad! |
Sorry, something went wrong.
|
I see. I found the corresponding bug report for this: eslint/eslint#16412 |
Sorry, something went wrong.
|
I've added a working, albeit rudimentary, lint rule. |
Sorry, something went wrong.
lib/ should never use the global (which is user-mutable) but instead require the internal module. There's already a lint rule for that: Lines 150 to 155 in 587367d |
Sorry, something went wrong.
Still -1 on this, I don't think this lint rule is a great addition, but won't block it.
Sorry, something went wrong.
PR-URL: #45817 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
Updates tests and some remaining documentation to use globalThis.crypto instead of require('crypto').webcrypto.
@aduh95 it would be great if we could make this into a lint rule but unfortunately the existing options I tried to do this with fall short: