Dart & AngularJS

Showing 1-19 of 19 messages
Dart & AngularJS Michael Chean 4/10/12 12:36 PM
Any chance that you plan on generating Angularjs at some time?
Re: [misc] Dart & AngularJS Seth Ladd 4/10/12 1:26 PM
Hi Michael,

AngularJS isn't on our radar right now. It would be an interesting project for someone to try, but we're not thinking about it right now.

Curious, what are the features of AngularJS that interest you?

Thanks,
Seth
Re: [misc] Dart & AngularJS Michael Chean 4/10/12 5:58 PM
Hi Seth:
I'm just looking at it now, and it seems very straight forward.  However, I understood that it's origin was from Google, so I thought maybe there
was some connections.  There are a number of efforts coming from Google in the language sphere, but they seem to be independent of each other.

Mike


On Tuesday, April 10, 2012 1:26:46 PM UTC-7, Seth Ladd wrote:
Hi Michael,

AngularJS isn't on our radar right now. It would be an interesting project for someone to try, but we're not thinking about it right now.

Curious, what are the features of AngularJS that interest you?

Thanks,
Seth




Re: [misc] Dart & AngularJS Seth Ladd 4/10/12 8:23 PM
Hi Michael,

I know it appears that way sometimes, even to us inside Google. Dart is looking at different web app frameworks for inspiration, and I know the team is aware of Angular.

Thanks for the suggestion,
Seth
Re: Dart & AngularJS Søren Kyndi-Wiuff 5/8/12 2:57 AM


>
> Curious, what are the features of AngularJS that interest you?
>

What would be most interesting is the two-way databinding that
AngularJS and similiar frameworks offers.
Re: [misc] Re: Dart & AngularJS Sam McCall 5/8/12 7:22 AM
+martinprobst
Martin has recently started using AngularJS on an internal project and
has been quite impressed. I hope something similar will emerge for
Dart.

The most important features seemed to be:
 * data binding, as Søren mentioned
 * templating at the DOM (rather than textual) level
 * client-side URL routing
 * separation of controllers, terseness through dependency injection
 * testability of controllers
 * rich set of builtin directives and services
 * extensibility (can write your own first-class directives)
 * excellent documentation :-)

Martin, anything to add?
Re: [misc] Re: Dart & AngularJS olouv...@gmail.com 7/17/12 4:33 AM
I'm also very interested by this.

That would be so awesome to have interoperability between the two projects, so that a JS user can commit today on a AngularJS app knowing they will have a window in the future to easily switch to Dart (& gain improved perf, etc.), and it would also promote the Dart language (to build real web apps). To me, you guys should definitely work together. This looks so critical today, as everything still seems fuzzy on where OO-programming complex web&mobile app will go in the next few years. Angular is getting some traction, it could clearly be a nice leverage for Dart.

I clearly dream of an AngularDart project that could compile to web apps (like app.js headless webkits) & native apps (like titanium but done right)...
Damn, it seems so far away...!


On Tuesday, May 8, 2012 4:22:40 PM UTC+2, Sam McCall wrote:
Re: [misc] Re: Dart & AngularJS Shannon -jj Behrens 7/17/12 9:02 AM
I personally like AngularJS as well. I spent some time hanging out with the AngularJS guys a few weeks ago. Although I know the Dart team is working on their own client-side framework, it is my personal opinion that there will be many ways to build web applications in the future even in the Dart community, just as there are many ways to build web applications in the JavaScript community today. Naturally, many approaches will be created by non-Googlers. I think we're already seeing that in the Dart community. I also think that interoperability with JavaScript is something that's critical for Dart, and it's something I know we're working on.

Happy Hacking!
-jj--
Shannon -jj Behrens | Developer Advocate for YouTube APIs | apiblog.youtube.com | @YouTubeDev

Re: [misc] Re: Dart & AngularJS Vincent Spallek 8/7/12 8:34 AM


On Tuesday, May 8, 2012 4:22:40 PM UTC+2, Sam McCall wrote:

The most important features seemed to be:
 * data binding, as Søren mentioned
 * templating at the DOM (rather than textual) level
 * client-side URL routing
 * separation of controllers, terseness through dependency injection
 * testability of controllers
 * rich set of builtin directives and services
 * extensibility (can write your own first-class directives)
 * excellent documentation :-)

I'd like to add:
* support for existing HTML/CSS tool chains, because AngularJS works on valid HTML files. (Different from Buckshot, which uses its own XML scheme)
Re: [dart-misc] Re: [misc] Re: Dart & AngularJS Seth Ladd 8/7/12 9:23 AM
Thanks Vincent. One open question is minification, a common step in a build process tool chain. Current minifiers only get us so far with dart2js output, because dart2js (last time I checked) uses string names for method invocation (sometimes). That's harder to minify. I think the dart2js team has minification on their radar, though.

The Dart team is embracing web components, which are the future of composable web apps. With web components, you'll use normal CSS and HTML to create new tags like <x-widget>. I wouldn't be surprised if Buckshot evolved to use web components to power its components.

Thanks for the feedback!
Seth


--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart
 
 

Re: [dart-misc] Re: [misc] Re: Dart & AngularJS John Evans 8/7/12 10:12 AM
You are so right Seth.  Web components are definitely on my radar for Buckshot's rendering routines.


On Tuesday, August 7, 2012 11:23:13 AM UTC-5, Seth Ladd wrote:
Thanks Vincent. One open question is minification, a common step in a build process tool chain. Current minifiers only get us so far with dart2js output, because dart2js (last time I checked) uses string names for method invocation (sometimes). That's harder to minify. I think the dart2js team has minification on their radar, though.

The Dart team is embracing web components, which are the future of composable web apps. With web components, you'll use normal CSS and HTML to create new tags like <x-widget>. I wouldn't be surprised if Buckshot evolved to use web components to power its components.

Thanks for the feedback!
Seth


On Tue, Aug 7, 2012 at 8:34 AM, Vincent Spallek <> wrote:


On Tuesday, May 8, 2012 4:22:40 PM UTC+2, Sam McCall wrote:

The most important features seemed to be:
 * data binding, as Søren mentioned
 * templating at the DOM (rather than textual) level
 * client-side URL routing
 * separation of controllers, terseness through dependency injection
 * testability of controllers
 * rich set of builtin directives and services
 * extensibility (can write your own first-class directives)
 * excellent documentation :-)

I'd like to add:
* support for existing HTML/CSS tool chains, because AngularJS works on valid HTML files. (Different from Buckshot, which uses its own XML scheme)

--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart
 
 

Re: [misc] Dart & AngularJS Steve Gentile 5/15/13 4:17 AM
When I see code like this:
TextAreaElement chatElem = query('#chat-display');
InputElement usernameElem = query('#chat-username');
  • InputElement messageElem = query('#chat-message');
Basically the 'jQuery' way of writing apps, versus using MVVM AngularJS approach

$scope.chatmessage

ng-bind="text: chatmessage"

I think Dart is going 'backwards'.  What surprises me though of these answers is that Dart is a language isn't it ?  AngularJS is a framework.

So the question I have is - 'how can the Dart language, which compiles down to javascript be used with the AngularJS framework'.  If Dart can't run javascript frameworks then it's just yet another proprietary language, reminiscent of using something like GWT.

I'd be very disapointed to learn Dart developers wouldn't be actively working with AngularJS devs to promote building AngularJS applications  written in Dart.
Re: [dart-misc] Re: [misc] Dart & AngularJS Zdeslav Vojkovic 5/15/13 4:50 AM
"If Dart can't run javascript frameworks then it's just yet another proprietary language,"
well, JS can't run Python libs, can it, does it make it more or less of a proprietary?

Dart is not CoffeeScript or TypeScript - it has different goals and is not meant to be just a preprocessor for javascript.
Actually, you can use JS interop to work with JS libraries, but that is not the way it is meant to be used, it is simply a workaround for current lack of libraries, as Dart is rather new.

Your sample compares apples to oranges - the Dart part is not idiomatic way to bind data to GUI.
Dart also supports model driven views and web components which use data binding, and that is similar to AngularJS approach.
This means that you have both jQuery-like approach available (as a part of core lib) and model driven approach, based on emerging HTML standards (MDVs, templates, etc)

sure, Dart has its drawbacks, but IMO it is often misunderstood


--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new
 
 

Re: [dart-misc] Re: [misc] Dart & AngularJS Mike Watson 5/15/13 6:09 AM
> Actually, you can use JS interop to work with JS libraries, but that is not the way it is meant to be used, it is simply a workaround for current lack of libraries, as Dart is rather new.

I disagree with this statement. If JavaScript is the assembly language of the web, then JS interop is the linker. The number of useful JavaScript libs will continue to grow at a pace far faster than Dart versions can be created.
Re: [dart-misc] Re: [misc] Dart & AngularJS Steve Gentile 5/15/13 6:16 AM
Ok that is fair - I am guilty here of a contempt prior to investigation - as I see the MDV and templates, @observable (aka KnockoutJS).

It feels very GWT to me with just a new language syntax but very 'java' like - I guess that is the 'misunderstanding' of it.

I'd like to see more on view composition, routing, controls, etc... for building large single page applications.

There are a bazillion javascript libraries, solving many of our day to day problems - and so if I'm going to build a SPA in Dart, I'm going to need access to this - not sure if creating 'wrappers' around it in an interop fashion - it just feels messy to me.  I'm not sure I get the Dart story behind this - as if Dart is expecting the entire community of javascript users to rewrite everything into web components ?

I'll keep researching, this is my first impression - I was seeing Dart as you say as a 'preprocessor for javascript'
Re: [dart-misc] Re: [misc] Dart & AngularJS Matthew Butler 5/15/13 6:37 AM


On Wednesday, May 15, 2013 10:16:51 AM UTC-3, Steve Gentile wrote:

There are a bazillion javascript libraries, solving many of our day to day problems - and so if I'm going to build a SPA in Dart, I'm going to need access to this...


Truthfully, you need to stop looking at javascript for solutions to your dart problems. Otherwise you're going to bind yourself up tighter and make life more difficult for yourself. Yes, Javascript has many many years head start on Dart in terms of libraries and frameworks. However many in the dart community (and even by the dart team themselves) have started addressing the issues you speak of. See: web_ui, route, rikulo, bee, widget, dart web toolkit, haml, hart, etc etc etc... on pub.dartlang.org 

as if Dart is expecting the entire community of javascript users to rewrite everything into web components ? 

Google started this process with web_ui, route, and of course the core libraries for Dart. Netscape didn't release javascript and 'expect the entire community to write everything'. It just happened as developers either found a need, or wanted to correct a need in their own way. So to are developers choosing to use dart to write a library rather than using or creating one in Javascript because they feel dart is the language they would prefer to use. For an example as to why... well see the popular blog post by the Thomas Schranz http://www.ramen.io/post/46936028144/we-are-switching-to-dart-why and follow up interview: http://www.infoq.com/news/2013/04/blossom-dart-switch

Their reasons may not fit your reasons, and that's okay. Dart may not even be the solution you want. But for a growing number of developers it is.  =) 
Re: [dart-misc] Re: [misc] Dart & AngularJS Mike Watson 5/15/13 8:06 AM
> Truthfully, you need to stop looking at javascript for solutions to your dart problems.

It depends on where your focus is. I agree with your statement if you are targeting the Dart VM.

Since we don't know where the Dart VM will end up, chances are you will use Dart2js for cross browser operation.  Converting useful JavaScript libs to Dart and then back to JavaScript with Dart2js is counter-productive. I don't think anyone is saying to do this, but that leaves the question open as to how efficient JS interop is for this use case. This has been noted before and will continue to be looked into. I'm really not trying to be argumentative but rather trying to keep this as my focus. I can't  jump on the Dart bandwagon and leave JavaScript behind until the Dart VM runs in more places.
Re: [dart-misc] Re: [misc] Dart & AngularJS Thomas Schranz 5/15/13 9:48 PM
Hey Mike,

I'm glad you're interested in Dart. If you take some time to play around with it you'll see how much sense
the language, standard lib & working with packages is. It's unsurprising and you can get going in minutes.

I understand that initially it might sound counter-productive to port js libraries to Dart if all that happens is
you compile it to js again to use it in the browser. That said it actually makes a lot of sense. Usually you'll spend
a significant amount of time working in your code-base, enhancing it, changing stuff, refactoring things, …

In that day to day work having your code base in Dart yields a ton of benefits that are relevant for the day-to-day of development.

* Dart is easier to work with as a language
* The tooling (Dart analyzer) will warn you about issues that no JavaScript IDE will warn you
* Compared to js it is way easier to work with packages (Dart supports it out of the box)
* You will get exceptions if something in your code went wrong at a time when you expect it (sooner rather than later).
* No more confusion about what 'this' is and support for classes out of the box
* …

I'm obviously biased but from my POV using Dart right now (compiled to JS) already yields almost all the benefits for your day-to-day development.
Of course it would be beautiful and more pure and even faster to be able to use the Dart VM and I'm confident we'll get there eventually
but Dart as a platform is very viable today already :)

Sorry the post got so long, I didn't have the time to make it shorter. I'm sure you'll like what you see when you play
around with Dart. Here are the getting started tutorials, great weekend project: http://www.dartlang.org/docs/tutorials/
Re: [dart-misc] Re: [misc] Dart & AngularJS Mike Watson 5/16/13 8:35 AM
Hi Thomas, thank you for being a passionate advocate for Dart. I really like Dart as well for all the reasons you've outlined. I wrote my app in Dart because I wanted to do rapid prototyping, easy refactoring and type assistance. I deliberately kept things as simple as possible, sort of a jQuery with classes pattern, just in case I had to convert it to JavaScript by hand for an earlier IE browser (so far I haven't had to do that). I'm sold on Dart.

It is my belief that js-interop is a key feature. I agree that there are advantages to converting JavaScript to Dart to work with even if you are going to convert it back to JavaScript with Dart2js, but there are many cases where this doesn't make sense.

For example, if I were to use the jStat library: http://www.jstat.org/ I might want to use the core functionality and do the plotting in Dart instead of using the flot jQuery plugin. I don't have time, there is no need and it would be error prone to convert the core functionality of jStat to Dart. Maybe someday the author will. I can just use it as is with js-interop, that is a key feature.

However, js-interop in it's current state is not optimal. For example, with a simple 'Hello from Dart' and 'Hello from JavaScript' program.  (following is unminified)

'Hello from Dart' by itself is 31k
'Hello from Dar't with 'Hello from JavaScript' through js-interop is 446k

minification cuts those figures in half

That's a lot of proxy code!

Since I want Dart to succeed and think js-interop is a key feature, I would like to see js-interop brought into the SDK and more people working on it. I would volunteer myself if I had time. 

Mike

import 'dart:html';
import 'package:js/js.dart' as js;

void main() {
  js.context.sayHello();
  window.alert('hello from Dart');
}

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Jsinteroptest</title>
    <link rel="stylesheet" href="jsinteroptest.css">
    <script type="text/javascript">
    function sayHello()
    {
      alert('hello from JavaScript');
    }
    </script>
  </head>
  <body>
    <script type="application/dart" src="jsinteroptest.dart"></script>
    <script src="packages/browser/dart.js"></script>
  </body>
</html>