Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Where is JS Interop used in the first example? (It's a bit hard to tell with the wildcard imports how much of that is actually coming from web.dart.)


Web.dart is basically designed to give you the equivalent of any of the browser based APIs you would find on MDN essentially unchanged so things like document.querySelectorAll and things like that would just work as though you were using JavaScript (and you technically are in the background) but without otherwise needing to ever leave Dart.


Well, sure, but web.dart is one of the original packages that came with Dart. That part isn't new.


That’s not actually correct I don’t know where you got that from. This is from this year and was built on top of a wider rewrite of their JS interop using new language features to make it essentially a zero cost abstraction.

Dart has had browser support and DOM APIs before but never had the same APIs you have in the web platform before.


I think I had it confused with dart:html, which looks almost the same. I don't see a big difference in the example code.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: