app-router icon indicating copy to clipboard operation
app-router copied to clipboard

Port to dart

Open Bmooij opened this issue 10 years ago • 7 comments

Would you consider to port this to Dart?

Bmooij avatar Nov 14 '14 16:11 Bmooij

I've never used Dart so I can't speak too well about what it would take to port it. The router is all native DOM and there aren't any dependencies on Polymer. What changes typically need to be made to make JS/HTML things work with Dart?

erikringsmuth avatar Nov 14 '14 18:11 erikringsmuth

Sorry for the late reaction...

Dart works with pub instead of bower. The code doesn't have to change to use in Dart. Only the project structure needs to be changed.

If it is possible, you can completely port the app-router to Dart. There for you only have to port the JavaScript to Dart. (Dart can generate the JS files from the Dart files).

Bmooij avatar Nov 24 '14 10:11 Bmooij

If it's a simple change I'll switch the project structure to work with Dart. If you create a fork with an example, that'd be awesome. Otherwise I'll get to it eventually.

As for completely switching the code base to Dart, I'd have to see what the generated JS looked like and how much control I'd have over it. I know the JS/HTML DOM like the back of my hand. Not that it's a good thing, but I can tweak it to my heart's content. Dart DOM may be far superior but I'm skeptical until I use it and see how it transpiles.

erikringsmuth avatar Nov 24 '14 13:11 erikringsmuth

I'm working on project with Polymer and Dart now, but I don't understand how can I use app-router (even on native JS) inside my Dart app. If I will solve the issue by myself, I'll post here tutorial. Or maybe someone already did that?

privettoli avatar Feb 03 '15 19:02 privettoli

I don't know why I didn't post here sooner, but here's the Dart port (i.e. for use with Polymer.dart projects, but also written in Dart): https://github.com/pjjjv/app-router-dart. I should probably mention it's experimental still.

pjjjv avatar Feb 19 '15 20:02 pjjjv

Cool! It looks like it's more complicated than a simple transpile from JS to Dart so it'll probably have to be maintained separately.

Mind keeping the original license (MIT) and a modified copyright with both of our names? I'm not a big fan of GPL and copyleft for web libraries.

erikringsmuth avatar Feb 20 '15 00:02 erikringsmuth

Thanks! I got a comment from Alex on https://plus.google.com/wm/1/+Pieter-JanVandormael/posts/VUL4BbV9g7S that he had the "transpiled" version almost working, and I got in touch, but so far I haven't seen a sign of that version. I tried it myself before and for me it was not working for this project so I gave up and started to work on this actual port.

I changed the license to MIT and added you to the copyright. I haven't updated exactly all files yet, but I'll work that out soon.

pjjjv avatar Feb 20 '15 19:02 pjjjv