Hacker News new | past | comments | ask | show | jobs | submit login

I think with native Promises (and async/await?) there is currently no way to implement something like Zone.js properly. I've tried to instrument my code manually, but it's really error-prone and verbose. We really need something like https://nodejs.org/api/async_context.html#class-asynclocalst... to be implemented in the browser.



You can follow [0] which is currently stage 2 to fix this

[0]: https://github.com/tc39/proposal-async-context


In addition to this, is the new (stage 3 even!)explicit resource management proposal[0], supported by TypeScript version >= 5.2[1]

Though I agree that async context is better fit for this generally, the ERM should be good for telemetry around objects that have defined lifetime semantics, which is a step in the right direction you can use today

[0]: https://github.com/tc39/proposal-explicit-resource-managemen...

[1]: https://www.totaltypescript.com/typescript-5-2-new-keyword-u...


Thanks! I was only aware of a Zones proposal which was withdrawn I think.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: