-
Notifications
You must be signed in to change notification settings - Fork 335
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
Move initial Node.js polyfills to workerd #334
Conversation
9c86202
to
c185c5e
Compare
@@ -30,6 +30,6 @@ wd_api_bundle( | |||
internal_modules = dict([( | |||
m.removesuffix(".ts") + ".js", | |||
"node-internal:" + m.removeprefix("internal/").removesuffix(".ts"), | |||
) for m in internal_modules]), | |||
) for m in internal_modules if not m.endswith(".d.ts")]), |
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.
thanks for taking care of this.
@@ -2,7 +2,7 @@ | |||
"compilerOptions": { | |||
"target": "ESNext", | |||
"module": "ESNext", | |||
"lib": [ "ESNext" ], | |||
"lib": [ "ESNext", "DOM" ], |
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.
todo for myself: replace this with either smaller definition or use generated .d.ts types (preferred).
@@ -0,0 +1,17 @@ | |||
import { EventEmitter } from 'node:events'; |
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.
you can also easily add an import test to https://github.com/cloudflare/workerd/blob/main/src/workerd/api/node/node-test.c%2B%2B (maybe for async context?)
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.
Yeah, I'll be porting the tests we have in the internal ew-test files out to here separately
c185c5e
to
f58fa07
Compare
@mikea the key pieces to review here are the changes to the bazel build file and the tsconfig. Everything other than the sample modifications are a straight copy of the TS files.