Exactly. In the browser (and node) it's not really a question of how Dart compares to TS / ES6 (for example), but how Dart + ease of using JS libs compares to TS / ES6 + ease of using JS libs. And of course that makes sense.
TS is a language where the primary goal is seamless JS interoperability. Presumably, it will always make design tradeoffs to maintain that.
Dart is a language where the primary goal is developer productivity. The team decided that it required a clean break from JS to achieve that.
The tradeoff being that JS interoperability is harder.
So it's not a great surprise that TS wins in the JS interoperability front. Dart has made big improvements here recently and continue to do so and I expect the gap to continue to close but never quite go away.
Similarly, it's not a great surprise (to me at least) that Dart is a cleaner more productive language. As many have said ES6 has made big improvements over ES5 and coupled with TS has significantly closed the gap to Dart.
I see this trend continuing. With Dart maintaining an edge in language features + productivity and TS with JS interoperability ease, but the gaps in both aspects being small enough that it is a matter of personal choice and what best fits the project.
I've done many many years Java, then hit Dart and was very impressed.
Since that I have had to do a fair bit of python, php and JavaScript at work. I think if I hadn't seen Dart first I would have quite liked python.
The problem with Dart is that once you've been developing in it for a while it spoils you from liking anything else. I really cringe with python, JS etc autocompleting to a million irrelevant things.
And going back to Java you have the slow dev loop that comes with a compiled language.
At the end of the day I've simply never had a development experience anywhere near as productive and enjoyable as Dart.
When a new language is created, its feature set is a product of the times it is created in. i.e. what features are considered useful, popular, best practice etc.
Of course times change and with it what this set of desirable features is. Languages evolve by adding support for some of these new features.
But adding these new features whilst preserving the old becomes increasingly difficult and the new features tend to be somewhat hobbled and don't fit that well with the older features.
For the first 10 years or so this tends to be ok but when languages get to the 10 - 20 year mark they start looking increasingly like frankensteins monster - a mixture of parts from different places / eras, none of which work terribly well and which don't fit that well with others.
At some point IMO it's worth jumping to a new language despite the smaller community and package availability. But it's often only when you do try it for a while when you realise how much better the dev experience is compared to the frankenstein languages which have on paper adopted similar features.
To me this is where Java, JavaScript, Python etc are now. On paper they can claim many of the features now that Dart has but the experience using them is not that of using those features in Dart.
I can't imagine there are many decent developers who if they really give dart a proper go, wouldn't much prefer to work with it than JavaScript.
TS is a language where the primary goal is seamless JS interoperability. Presumably, it will always make design tradeoffs to maintain that.
Dart is a language where the primary goal is developer productivity. The team decided that it required a clean break from JS to achieve that. The tradeoff being that JS interoperability is harder.
So it's not a great surprise that TS wins in the JS interoperability front. Dart has made big improvements here recently and continue to do so and I expect the gap to continue to close but never quite go away.
Similarly, it's not a great surprise (to me at least) that Dart is a cleaner more productive language. As many have said ES6 has made big improvements over ES5 and coupled with TS has significantly closed the gap to Dart.
I see this trend continuing. With Dart maintaining an edge in language features + productivity and TS with JS interoperability ease, but the gaps in both aspects being small enough that it is a matter of personal choice and what best fits the project.