-
Notifications
You must be signed in to change notification settings - Fork 52
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
Make it work in the browser #14
Comments
It's coming, probably sooner rather than later. It's figuring out where the boundaries are and coming up with a compatible way of shimming e.g. XHR that makes it tricky, but I like a challenge. Also, PRs welcome! 🎆 |
You shouldn't need to manually shim XHR. Just use the |
Something like We would still need to hook into other things like IndexedDB. |
If you're going to write browser-specific code :( then you might as well just use XHR directly. The XHR 2 API is actually not that bad. |
@feross Someone was going to write a single module you could require that did that, Every HTTP client I've written so far has had a different implementation for browsers & node. |
Hmm... that I really like this approach of take an API that lots of people are familiar with and matching it exactly but making it work in the browser. For example, I did that for the |
@feross https://github.com/Raynos/xhr its a subset of |
Neat! |
To work properly, If you look at Angular's zone.js, which is a browser equivalent of |
cc @btford zone.js looks like a start to async-listener for browsers :D Lets do this! |
^ I was just going to mention zone.js (https://github.com/btford/zone.js/) |
Hi guys!
@othiym23 is there any particular API that you know to be unpatched? The goal for zone.js is to be completely comprehensive in wrapping async APIs in the browser. |
@btford indexeddb, html5 file system, webrtc, requestAnimationFrame, setImmediate, EventSource, history api, postMessage, webworker, websockets, Webgl. Some of them may be supported indirectly through EventTarget |
Hey, Brian! I didn't mean browser APIs, although @Raynos's list is pretty exhaustive. I was more responding to the fact that the last time I looked at zone.js you were saying that some browsers / browser versions weren't quite working yet. This was relevant to me in particular because my coworkers are looking for something like a browser version of CLS that works with pretty much every browser ever. |
@othiym23 gotcha. The only caveat WRT some browsers not working is a known bug in Chrome. I have a workaround in progress, but my hope was that Chrome would fix the bug before I finished my ugly hack. Unrelated: I added a link from zone.js's readme to this project. :D |
@othiym23 I think there is no way to intercept |
👍 |
Note: Re-visit strongloop/loopback#1020 once this has completed. |
:D
cc @feross @Matt-Esch
Use case: A long stack traces module that works everywhere.
The text was updated successfully, but these errors were encountered: