| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Kinda feeling "meh" on repeating the web's mistakes, but I can see the point for web compat.
Sorry, something went wrong.
|
I also don't really see the point for this API in Node.js, especially since ours (.toString on buffer) is arguably better and this API does not actually improve web compatibility by much since it's not global (and global probably isn't worth the breakage) |
Sorry, something went wrong.
|
Yep. It's been a long standing open feature request, and is implemented in other platforms, it was a quick impl so I figured let's see what the reaction is. I'm fine with not having this either. I'll close this and close the feature request issue as a #wontfix. |
Sorry, something went wrong.
|
I'm reopening this as I've had three separate, independent conversations with different folks in the past two weeks about the lack of atob/btoa in core. Yes, it's not as good as what we already have, and no, I don't see it as being critical, but the implementation is simple and easily maintained and it does improve cross-platform interop. |
Sorry, something went wrong.
|
@jasnell why couldn’t they be globals? (I’m sure there’s discussion somewhere, but I’d love to read it linked from here) |
Sorry, something went wrong.
|
Globals are semver major. If this lands I'll open a separate commit adding that. But this way it allows us the option of backporting the basic impls to 15 and 14 |
Sorry, something went wrong.
|
awesome, sounds like a great plan |
Sorry, something went wrong.
There was a problem hiding this comment.
Just making sure this doesn’t land until it has a big, bold warning against using it (or deprecation notice, tbh – I’d personally say that introducing this as a deprecated feature from the start would be just fine, but I’m guessing not everybody’s on the same page there…)
Sorry, something went wrong.
|
I'd be -1 for introducing as deprecated but I'm definitely adding a notice in the docs as suggested. I definitely say we need a new status indicator in the docs that Is-Not-Deprecated-But-Is-Also-Not-Recommended |
Sorry, something went wrong.
Sorry, something went wrong.
|
The JS spec is going to use the term "legacy" for "things that are icky that we wish we could get rid of", if that helps :-) |
Sorry, something went wrong.
|
That does help, actually. There are a few APIs in core that are currently deprecated but really fall under that legacy category instead. I may have to open a PR adding that in as an option |
Sorry, something went wrong.
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
|
|
||
| const lazyInvalidCharError = hideStackFrames((message, name) => { | ||
| if (DOMException === undefined) | ||
| DOMException = internalBinding('messaging').DOMException; |
There was a problem hiding this comment.
why do we always have to lazily load this constructor?
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, it's gotten a bit out of hand really. I'm doing it for consistency. I recently landed a PR that updated the various AbortError instances to eliminate this in multiple places but there are still more. What would be good is a PR that moves DOMException into `internal/errors' and replaces these lazy loads for that.
Sorry, something went wrong.
|
I'm still -0 on this (since right now we're just adding the bad methods without improving compatibility since they're not global) but I see the merit if they're global in the next major. |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #37977 Notable changes: * buffer: * implement btoa and atob (James M Snell) #37529 * deps: * upgrade npm to 7.7.6 (Ruy Adorno) #37968 * doc: * add legacy status to stability index (James M Snell) #37784 * add @Linkgoron to collaborators (Nitzan Uziely) #37817 * http: * add http.ClientRequest.getRawHeaderNames() (simov) #37660
PR-URL: #37977 Notable changes: * buffer: * implement btoa and atob (James M Snell) #37529 * deps: * upgrade npm to 7.7.6 (Ruy Adorno) #37968 * doc: * add legacy status to stability index (James M Snell) #37784 * add @Linkgoron to collaborators (Nitzan Uziely) #37817 * http: * add http.ClientRequest.getRawHeaderNames() (simov) #37660
PR-URL: #37977 Notable changes: * buffer: * implement btoa and atob (James M Snell) #37529 * deps: * upgrade npm to 7.7.6 (Ruy Adorno) #37968 * doc: * add legacy status to stability index (James M Snell) #37784 * add @Linkgoron to collaborators (Nitzan Uziely) #37817 * http: * add http.ClientRequest.getRawHeaderNames() (simov) #37660
| Back | FazBrowse Home | New Git URL |
Web Platform atob and btoa impl.
Just an initial get it working impl, not performance optimized.
Signed-off-by: James M Snell jasnell@gmail.com
Fixes: #3462