localvoid / liquid

[UNMAINTAINED] Library to build User Interfaces in Dart [Virtual DOM]
http://localvoid.github.io/liquid/
BSD 2-Clause "Simplified" License
29 stars 3 forks source link

vdom.a ( ) disappeared #6

Closed Zeug-9 closed 9 years ago

Zeug-9 commented 9 years ago

In this new version vdom.a ( ) disappeared is this normal

tosh commented 9 years ago

I also noticed it yesterday. It got renamed to anchor. I also would expect it to stay available as a to stay consistent with the basic tags.

Maybe the behaviour of anchor is different from a?

localvoid commented 9 years ago

a tag is used either as links (href, title properties) or anchors (name property).

I've started to add elements that have commonly used properties as object properties instead of "attributes".

https://github.com/localvoid/liquid/blob/master/lib/src/vdom/elements/link.dart

link(href: 'url.html')

Initially I wanted to add this to "a" function, then I've started to write class VA extends VNode { ... }, and I don't like this VA that can appear in stack traces, I also don't like one letter top-level-declarations, it feels like I am doing something that is terribly wrong :) Then I've looked at dart api AnchorElement and just renamed it to anchor.

Alternative solutions:

Zeug-9 commented 9 years ago

anchor() replaces me very well a() thank you

tosh commented 9 years ago

I think it makes sense to keep support for 'a' so people don't have to re-learn when they already know html well. This also makes it easier to port existing markup.

That said, I also think it makes sense to 'clean up' html problems and to introduce idiomatic liquid basic components for often used things that map better to reality and intent and ignore legacy (like anchor & link?).