letsvote icon indicating copy to clipboard operation
letsvote copied to clipboard

Any plans on supporting Dart 2.0?

Open melo0187 opened this issue 6 years ago • 3 comments

Hi there, I just came across your blog post after pondering for a while about how to use Dart to get the most code reuse for front ends across web and mobile, so thank you very much for sharing!

I just wanted to give this a try myself, but stumbled across the fact that this does not support Dart 2.0 yet. Therefore I already fail at the attempt of getting the deps for the web server. Simply changing the SDK specified from '>=1.20.1 <2.0.0' to '>=1.20.1 <=2.0.0' won't do the trick, because of the dependency to shelf_cors 0.2.1 (which apparently is the latest publicly available release of this package, which itself again requires SDK version <2.0.0).

I'd love to get your thoughts about the current state of this repository, if you deem it worthwhile to maintain and if it is illustrating a still valid approach to a front end strategy aiming for code reuse.

In the meantime I'll see whether I can get this running with current stable Dart, which will hopefully result in a useful PR. Any pointer are much appreciated =)

melo0187 avatar Sep 05 '18 05:09 melo0187

Yes, we need to completely re-write the web app to be an AngularDart app. It's on my (long) list of things to do but I hope I'll eventually get to it.

If you would like to make a PR you are more than welcome - it might be a fun exercise!

johnpryan avatar Sep 05 '18 18:09 johnpryan

Hey, thanks for the quick reply! I'm happy to hear that this is something you are considering.

Since I got introduced to Dart only through Flutter and only a few months ago, I won't be able to do the rewrite you describe without properly educating myself. So this might take a long while, but I still plan to do this, since I wanted to look into this for my local JavaScript meetup group anyway =)

But there is still a more general question that comes to mind: What about the teams that simply won't use Angular? Is Flutter and AngularDart the only valuable option for proper Dart code reuse between front ends?

Maybe my thoughts around dart2js and "just" applying a clean layered architecture so that your business logic lives in an independent dart package that you can just import in Flutter and just transpile and link to in your web project are too naive?

Thanks for sharing your insights!

melo0187 avatar Sep 05 '18 18:09 melo0187

good questions -

What about the teams that simply won't use Angular?

Angular is the only web framework that supports Dart 2 (and the the new build package) right now - react.dart still requires the Dart 1 SDK: https://github.com/cleandart/react-dart/blob/master/pubspec.yaml#L11 - that's not to say it won't in the future; I know Workiva still uses react with over_react heavily, but that only supports Dart 1 too.

Is Flutter and AngularDart the only valuable option for proper Dart code reuse between front ends?

Short answer: yes. Long answer: we (at AppTree) are using Dart 1 and Dart 2 simultaneously, but it's an uncommon use-case because we use PolymerDart. We actively working to switch from PolymerDart to AngularDart.

Maybe my thoughts around dart2js and "just" applying a clean layered architecture so that your business logic lives in an independent dart package that you can just import in Flutter and just transpile and link to in your web project are too naive

It's not naive, we've been able to do this (and you can too.) - that's the point of the project!

johnpryan avatar Sep 05 '18 18:09 johnpryan