Question

I'm just starting to write a web application, and I thought it would be fun to use Dart and Angular.dart for it. I've used Dart and Angular.js both a little bit, and I like them.

I'd like the application to actually be useable by most internet users, though, and it seems like maybe Angular.dart (or at least some of Angular.dart) relies on the shadow dom. From what I can tell, Chrome is the only major browser that supports the shadow dom at all, and even if Firefox, IE, and Safari all implement it, that could be years from now.

I actually tried running Chapter 3 from the Angular.dart tutorial with the dart2js compiler, and the page it made seemed to work fine in Chrome, but failed in Firefox and IE11.

Is my assessment here accurate? Will it probably be a couple years at least before Angular.dart will be useful outside of Chrome? Are there plans for Angular.dart to allow alternatives to its dependency on the shadow dom?

I fear I'll be forced to chose between Angular.js (not nearly as much fun), and Dart with maybe only Polymer.dart (not as nicely / easily structured).

Was it helpful?

Solution

Using Shadow DOM on browsers that don't support it isn't a problem in most cases. There is a polyfill that adds support for Shadow DOM to every modern browser.

I'm not sure about the state of Angular.dart, but at least Polymer.dart is automatically including the Shadow DOM polyfill at the moment.

Using Shadow DOM shouldn't be a problem at all.

OTHER TIPS

Shadow DOM will be an issue on some mobile browsers. The Shadow DOM patch/work around with JavaScript (to provide the functionality to browsers without it built in) isn't quite there yet and constantly suffers from bugs. I even had to use the debug version of it for a while.

While I'm using Angular.dart (and therefore Shadow DOM) in production, I would not recommend it if you can avoid it. For now. It will be pretty awesome though in the future.

So, actually, I do consider it an issue. Polymer and now Angular.dart are looking toward the future and that's great...But they should not be used unless you really can control things a bit. If you can build an app where you know people are using specific browsers only, then you won't have a problem. Otherwise, you most definitely will. At some point.

You have to consider the differences in styling content within the shadowDOM. This may be a advantage or disadvantage depending on your requirements.

A Guide to Styling Elements

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top