Dart for web with no framework.

864 views
Skip to first unread message

Giovanni Panaro

unread,
Jun 15, 2018, 9:23:11 PM6/15/18
to Dart Web Development
Hello,

I'm absolutely struggling to find any resources for web development without the use of angular. Dart used to have that great pirate guide on their website and they switched everything to angular. Can anyone offer any resources?

Thanks
-Giovanni Panaro

Daniel Sokil

unread,
Jun 15, 2018, 9:35:42 PM6/15/18
to Dart Web Development
I am also very interested in resources about web development in Dart without angular.

YegorJ

unread,
Jun 15, 2018, 11:24:42 PM6/15/18
to Dart Web Development
Stagehand has a "web-simple" template just for that. After that you can just use dart:html directly. Unfortunately dartdocs for dart:html are non-existent. My favorite resource is MDN. Their docs map to dart:html almost 1-to-1.

Lex Berezhny

unread,
Jun 15, 2018, 11:42:48 PM6/15/18
to w...@dartlang.org
If you want to do stuff with plain Dart and Web Components be prepared for a bumpy ride. It seems that the folks who work on Angular Dart are also the folks responsible for the web stuff and there is an obvious conflict of interest there. This issue on github illustrates the problem very well (including censorship when they don't like your point of view): https://github.com/dart-lang/sdk/issues/27445

It is possible to do it though; I wrote a word processor+spreadsheet combo for proposal writing in Dart using plain Web Components, you can see the code for that here (maybe it'll give you some inspiration on how to structure your own app): https://github.com/systori/systori/tree/dev/systori/dart/lib

The old version of Web Components mostly works okay and you can get a lot done, just watch out for some issues with initialization of components and exceptions getting swallowed (https://github.com/dart-lang/sdk/issues/25997). Also, keep in mind that Web Components v0 is not supported by any other browser.

Don't expect any progress on Dart for the Web as long as the Angular Dart team is also in charge of that stuff (unless you drink the Angular CoolAid and think Angular *is* the web, then Dart for Web is great!).

I don't mean to discourage anyone, Dart is still an awesome language, it's worth the effort to learn it and use it for web development despite the aforementioned issues. Just don't expect any support for this from the core team.

 - lex

Taylor Ren

unread,
Jun 16, 2018, 5:14:36 AM6/16/18
to Dart Web Development
You do not need to stick to Dart (and then bounded by Angular).

I have used PHP, React, Vue.js.

YegorJ

unread,
Jun 16, 2018, 9:28:14 PM6/16/18
to Dart Web Development
Lex,

AngularDart runs on top of dart:html, and is not required to write web-apps in Dart. You can use plain dart:html, with Angular nowhere in sight. That said, for an application, I would recommend using some framework, be it AngularDart, OverReact, or something built in-house. I would not recommend using dart:html directly, just like I would not recommend using plain HTML DOM API in JavaScript directly, for reasons the framework authors will give you.

It's a different story if you are building your own framework, in which case dart:html or package:js are good options. They expose the raw Web API without providing an opinion about how to structure your app. It is up to your framework to provide such an opinion.

I do not quite follow your arguments around Web Components. The Web API is orders of magnitude bigger than Web Components. Not using Web Components is far from subscribing to Angular CoolAid. A disclaimer though, I'm pretty ignorant about the web components, and I'm not sure what their support in web browsers or in dart:html is like these days. Although, caniuse.com is not very optimistic. When browser support picks up, I'll expect the Dart Web SDK to provide good access to that API.

Cheers,
Yegor

Lex Berezhny

unread,
Jun 17, 2018, 1:41:11 PM6/17/18
to w...@dartlang.org
On Sat, Jun 16, 2018 at 9:28 PM, YegorJ <yegor....@gmail.com> wrote:
Lex,

AngularDart runs on top of dart:html, and is not required to write web-apps in Dart. You can use plain dart:html, with Angular nowhere in sight. That said, for an application, I would recommend using some framework, be it AngularDart, OverReact, or something built in-house. I would not recommend using dart:html directly, just like I would not recommend using plain HTML DOM API in JavaScript directly, for reasons the framework authors will give you.

It's a different story if you are building your own framework, in which case dart:html or package:js are good options. They expose the raw Web API without providing an opinion about how to structure your app. It is up to your framework to provide such an opinion.

I do not quite follow your arguments around Web Components. The Web API is orders of magnitude bigger than Web Components. Not using Web Components is far from subscribing to Angular CoolAid. A disclaimer though, I'm pretty ignorant about the web components, and I'm not sure what their support in web browsers or in dart:html is like these days. Although, caniuse.com is not very optimistic. When browser support picks up, I'll expect the Dart Web SDK to provide good access to that API.

Cheers,
Yegor


You should educate yourself about Web Components. It is essentially a standards based web development framework built-in to browsers.

Chrome has v1 since earlier this year and has had v0 for years.
Safari has v1 since earlier this year.
Firefox has v1 and v0 since earlier this year but currently behind a flag.
IE says "Roadmap Priority: Medium — Development is likely for a future release."

How do you come to a conclusion of "not very optimistic" from this?

 - lex

nilsdoehring

unread,
Jun 18, 2018, 11:42:53 AM6/18/18
to Dart Web Development
Lex,

did you know that between 2013 and 2016, the Dart team developed and maintained polymer-dart? Even had a spotlight at Google I/O... just guessing here, but it seems like it lacked demand and got abandoned.

On a more personal note: While it's great to see you being passionate about web components, please try and respect that people might have other priorities – those of the Dart team have been explained to you in the link where you claimed you were being censored. As such, I do not understand why you felt the need to point out to OP 'obvious conflict of interest' of the Angular Dart team when it comes to web components. Whom, in the context of this post, does this opinion of yours benefit?

+niLS

Lex Berezhny

unread,
Jun 18, 2018, 12:42:28 PM6/18/18
to w...@dartlang.org
On Mon, Jun 18, 2018 at 11:42 AM, nilsdoehring <nilsdo...@gmail.com> wrote:
did you know that between 2013 and 2016, the Dart team developed and maintained polymer-dart? Even had a spotlight at Google I/O... just guessing here, but it seems like it lacked demand and got abandoned.

Yes, I'm very aware of the polymer effort but around 2016 Chrome added support for Web Components v0 and this was around the same time I started working on a big Dart web project, so it made more sense to go with that instead of polymer. Despite some issues Web Components v0 did the job and we released a product based on this, I'm happy I went with WC v0 and I really enjoyed Dart as a programming language (hands down better than JS).

Polymer was a way to do Web Components before it was available in the browser, sooner or later I think the project was guaranteed to be scraped (when Web Components become standard in all browsers).

On a more personal note: While it's great to see you being passionate about web components, please try and respect that people might have other priorities – those of the Dart team have been explained to you in the link where you claimed you were being censored. As such, I do not understand why you felt the need to point out to OP 'obvious conflict of interest' of the Angular Dart team when it comes to web components. Whom, in the context of this post, does this opinion of yours benefit?

My point was very simple: the OP was having trouble finding info on how to do plain HTML development with Dart and my response was to validate and shed more light on the frustrations they were experiencing. There is in fact a very strong bias against dart:html and for Angular Dart.

That issue that I linked to summarizes in the most succinct way possible the state of HTML in Dart vs Angular Dart and that was what the original poster was lamenting about (why so few HTML docs and so much Angular docs). My "opinion" explained why this was with evidence.

 - lex

Matan Lurey

unread,
Jun 18, 2018, 1:17:54 PM6/18/18
to w...@dartlang.org
Full disclosure: I am on the AngularDart team, and closed the original "censored" thread (it's certainly clear many people desire web components - but using a GitHub issue a space to complain isn't productive, unfortunately).

On Mon, Jun 18, 2018 at 9:42 AM Lex Berezhny <l...@damoti.com> wrote:
On Mon, Jun 18, 2018 at 11:42 AM, nilsdoehring <nilsdo...@gmail.com> wrote:
did you know that between 2013 and 2016, the Dart team developed and maintained polymer-dart? Even had a spotlight at Google I/O... just guessing here, but it seems like it lacked demand and got abandoned.

Yes, I'm very aware of the polymer effort but around 2016 Chrome added support for Web Components v0 and this was around the same time I started working on a big Dart web project, so it made more sense to go with that instead of polymer. Despite some issues Web Components v0 did the job and we released a product based on this, I'm happy I went with WC v0 and I really enjoyed Dart as a programming language (hands down better than JS).

Polymer was a way to do Web Components before it was available in the browser, sooner or later I think the project was guaranteed to be scraped (when Web Components become standard in all browsers).

On a more personal note: While it's great to see you being passionate about web components, please try and respect that people might have other priorities – those of the Dart team have been explained to you in the link where you claimed you were being censored. As such, I do not understand why you felt the need to point out to OP 'obvious conflict of interest' of the Angular Dart team when it comes to web components. Whom, in the context of this post, does this opinion of yours benefit?

My point was very simple: the OP was having trouble finding info on how to do plain HTML development with Dart and my response was to validate and shed more light on the frustrations they were experiencing. There is in fact a very strong bias against dart:html and for Angular Dart.

This is categorically untrue. They are very separate problems.

AngularDart (like AngularTS, Vue, React - and any other top X web framework in JS world) uses a very small amount of API surface from the DOM, and doesn't use web components. As mentioned by Yegor and a few others, they aren't yet supported in all browsers, and they don't solve critical problems. Here is an article by a lead of ReactJS (not Dart or AngularDart):

We’re not going to use it at all at Facebook. We’re not going to build React on it because there’s a strong model difference – imperative in Web Components to declarative in React. Web Components doesn’t have an idiomatic way to define things like where events go. How do you pass data when everything is a string? We see it more as an interop layer that lets various frameworks talk to each other.

To be clear: Nobody is advocating for removing support for dart:html, and moving everyone over to AngularDart. In fact, we'd love to see alternatives to AngularDart, like OverReact, or new-comers, become very popular and successful.


That issue that I linked to summarizes in the most succinct way possible the state of HTML in Dart vs Angular Dart and that was what the original poster was lamenting about (why so few HTML docs and so much Angular docs). My "opinion" explained why this was with evidence.

HTML is quite well documented on Google, MDN, and other resources.

The specific dart:html library is automatically generated from a series of Python scripts, and it is both a very difficult problem to make sure they have precise documentation and all have documentation (the breadth of the DOM APIs is much larger, than say, AngularDart).
 

 - lex

--
You received this message because you are subscribed to the Google Groups "Dart Web Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web+uns...@dartlang.org.
Visit this group at https://groups.google.com/a/dartlang.org/group/web/.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CAHQ_wW3oWov%3Dsp-pX80Mn-WHisqCxAPhztHDo3ZRLk%2BcafZAow%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages