Closed zhaopuming closed 8 years ago
The API definitely needs some simplifications like this for typical basic use-cases.
In addition to firstXXX methods, what I really want to get around to is defining an SDLang schema format (in SDLang, naturally) which could then be parsed at compile-time to auto-generate a really nice API and do all error-checking automatically.
But this is lower-hanging fruit and is definitely needed regardless.
we have .tags .attributes and other methods that return a range/array, but in most many cases there is only one children, it would be great if we can access that with .firstChild, .firstTag, or .firstAttr.
We can have some templates to generate these companion firstXXX methods.