-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(remix-node): use built-in atob
& btoa
#7206
feat(remix-node): use built-in atob
& btoa
#7206
Conversation
MichaelDeBoey
commented
Aug 21, 2023
- https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#atobdata
- https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#btoadata
🦋 Changeset detectedLatest commit: ecfdd23 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
8d1a748
to
636b234
Compare
aad7322
to
4de3fc6
Compare
784fa96
to
15515d4
Compare
I think this will resurface bugs like #1282 From linked node docs (followed link to
|
I see now that the parse/serialize is still using the This does make me wonder - does v2 release offer a path to move off of |
@shamsup Looking at the Bun, Cloudflare & Deno docs, they have them already available, hence why we currently only polyfilled them in our Node runtime
Even though these functions are marked as Since the Node team is working on Web API compliancy and looking at nodejs/node#37529 & nodejs/node#37786, the Node team admitted that they added If we look a bit deeper into nodejs/node#37529 & nodejs/node#37786, you can also see that So for now, I just wanted to remove the polyfills and use the global available functions instead. |
@MichaelDeBoey I understand the reasoning for this PR, thank you. I understand the |
@shamsup If you think you have a better solution that's cross-platform, we would be happy to accept a PR for that |
6b53ba5
to
e8feffc
Compare
I think we're doing the correct thing here now by not using the built ins, which according to the docs:
We're providing our own polyfills using the approach recommended by node, and only doing so in the node adapter. |
@brophdawg11 I would disagree with using our own polyfills for something that all platform(s) support built-in now As explained above, the Node team indeed prefers us to use the Having a polyfill for something that's cross-platform supported also means we'll have to maintain more code from our own for no reason at all in this case (the global functions are marked as |
I know that node uses I may be a stickler here, and I'm happy to be overridden by @jacob-ebey / @mjackson who are far more familiar with the cross-platform nuances than I am - but I'm just not comfortable shipping code that relies on something that "should never be used in new code" 🤷 Don't users have the same choice here of not calling |
@brophdawg11 As pointed out in my message before and as pointed out by the Node team in the linked issues/PRs, marking something as Those are all reasons I would say that using built-in
Another reason: what if the Node team has a better implementation at some point in time?
That would mean they still have to polyfill all other things we polyfill themselves, just for using these 2 globals |
I thought about this some more and am coming around to it. With all the It boils down to:
So two different scenarios but I think my brain was looking at them in the same light and looking at |
48f1b9e
to
a8edf48
Compare
Let's rebase this onto |
a8edf48
to
b43871b
Compare
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
1 similar comment
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |