erikringsmuth / app-router

Router for Web Components
https://erikringsmuth.github.io/app-router/
MIT License
610 stars 83 forks source link

Port to dart #37

Open Bmooij opened 9 years ago

Bmooij commented 9 years ago

Would you consider to port this to Dart?

erikringsmuth commented 9 years ago

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?

Bmooij commented 9 years ago

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).

erikringsmuth commented 9 years ago

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.

privettoli commented 9 years ago

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?

pjjjv commented 9 years ago

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.

erikringsmuth commented 9 years ago

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.

pjjjv commented 9 years ago

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.