Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Mark
node:
as external for Node.js compatibility #10544Mark
node:
as external for Node.js compatibility #10544Changes from 21 commits
8daecc5
dc77c14
2da8e64
4a3404e
01f3912
48e3f6b
823b599
11e3504
cb679a9
dd59513
5f91d0e
ad515c3
6b3c109
0ca2569
5e4bdd9
3ba4b44
9e77535
2d50b6a
c572a21
73faf43
925d8ec
390ba88
7df233d
b3a771f
df03b36
7692979
ea0ecb9
65b23fa
62dd0f5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
why pass it in if it's already specified in the
wrangler.toml
? https://developers.cloudflare.com/workers/runtime-apis/nodejs/#enable-nodejs-with-workersI think it'd be nicer to read it from the
wrangler.toml
to avoid making the user specify it twiceThere 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.
When deploy to Cloudflare Pages, the file
wrangler.toml
is not available.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.
Yes, but this is the Cloudflare Workers adapter 😁
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.
Hmm, sounds legit 🤔
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.
Oke, I'm going to make it read the
wrangler.toml
, not sure how could I do that. Maybe juststring.includes('node_compat')
? 🤔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, there is a
toml.parse
already.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.
Whitelisting
node:*
may be too aggressive. I think if we do that and someone uses an API likenode:fs
then they won't find out their app is broken until they go to deploy it and it'd be better for that to occur during build. How about we switch it to just the list of APIs that Cloudflare supports with their node compatibility?'node:assert', 'node:async_hooks', 'node:buffer', 'node:crypto', node:diagnostics_channel', node:events', node:path', node:process', node:stream', node:string_decoder', node:util'
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.
Yep that sounds legit. Cloudflare node_compat doesn't have modules like
fs
, ...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.
Is fixed in my latest commit
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.
May as well I remove
AdapterOptions.nodeCompat
and always include those externals? 🤔