-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
chore: use primordials #216
base: main
Are you sure you want to change the base?
Conversation
CC @isaacs |
src/primordials.ts
Outdated
@@ -0,0 +1,4 @@ | |||
export const primordials: any = // TODO export as typeof import('node-primordials'), types are wrong | |||
// @ts-expect-error | |||
typeof primordials !== 'undefined' ? primordials /* c8 ignore next */ : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think c8 ignore next
is a thing, is that new? I thought it only supported /* c8 ignore start */
and /* c8 ignore stop */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is. you can also specify the amount of lines. https://github.com/bcoe/c8/blob/main/README.md#ignoring-uncovered-lines-functions-and-blocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's somewhat new-ish, I think. (Like, added in the last 5 years or so probably lol.) Nice!
Test failures are spurious, should be fixed by rebasing onto main to update tap. |
184993c
to
aba228e
Compare
@isaacs PTAL |
'$', | ||
'\\', | ||
'!', | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does SafeSet
only take arrays, not arbitrary iterables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the implementation here https://github.com/isaacs/node-primordials/pull/9/files# I guess it would work with any iterable, but didn't try
Looks mostly fine. I'd like to get the PRs on node-primordials landed before landing this, so that it can be a simple dep update. Then the real question will be what the perf impact is, if any. If it's awful, we'll have to figure out some way to either mitigate it, or have the primordials version live side by side somehow with the normal code. |
ping @isaacs can you take a look? |
@isaacs as we discussed - I'v ran benchmarks on the glob repo: isaacs/node-glob@main...MoLow:node-glob:primordials
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MoLow:start-primodials
this is just a POC to start the process of node exposing
fs.glob
.if this PR will land, I will complete the process on all the rest of the code.
also, it seems like
node-primordials
needs some type fixes / additionsdepends on isaacs/node-primordials#8 and isaacs/node-primordials#9