Skip to content
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

Debugging Observables #55

Open
littledan opened this issue Sep 2, 2023 · 1 comment
Open

Debugging Observables #55

littledan opened this issue Sep 2, 2023 · 1 comment

Comments

@littledan
Copy link

When we’ve tried to use Observables libraries in Bloomberg, we’ve had some trouble reasoning about this code and debugging it. Not being able to step through the code, knowing which of multiple streams are stopped/started, or thinking about streams inside of streams, blows the majority of people's mental capacity budget, especially when maintaining code written by someone else.

Strong DevTools support could really help with a lot of these issues. I know it’s not something that goes in the actual specification, but having a plan here would be really helpful in understanding the realities of using this feature. Chrome has blocked shipping other features on adequate DevTools support (e.g., async/await). Do you have any particular plans related to Observables?

@benlesh
Copy link
Collaborator

benlesh commented Sep 22, 2023

Definite plans? Not from me, because I'm not really in a position. But I'd have asks.

Chrome did ship console.createTask recently, which is interesting and perhaps useful for debugging things like Observables written in the wild. It basically adds labels to stack traces. The major reason RxJS didn't adopt it is it added a lot of complexity to the code, and it also created even more closures. (Async Context may also be useful for RxJS for debugging reasons).

That said, if this was native and built into the browser, I would expect call stacks you'd see coming from user-land implementations like RxJS to be reduced by 4x-5x, because they would just be [native call] under the hood everywhere. It should be glorious.

If I had dev tools asks, it might be some sort of stream dependency visualizer that allowed folks to see where observables came from, what steps there were in the chain of observation, and gave them the ability to jump to certain lines of code or set break points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants