-
Notifications
You must be signed in to change notification settings - Fork 1
/
JSX_TODO
30 lines (30 loc) · 1.82 KB
/
JSX_TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- allow interpolated string attribute values eg %h1( id="recipe-#{ x }" )
- allow simple unquoted attribute values eg %p( key=i ) (or is this confusing/not preferable to HTML allowing unquoted attribute values?)
- handle inline element (with or without body?) followed by indent eg:
if isSomething %abc
x
- refine attribute error reporting so that eg %h1( x=[abc] ) will specifically tell you the attribute value is what's wrong
- refactor attribute value nested lexing to share code with matchWithInterpolations()
- compile empty element to eg <a /> instead of <a></a>? is there a semantic difference to JSX and/or HTML?
- className and other attribute-name translations (automatically camelCase, that's what JSX wants?)
- allow line-ending inline comments after inline elements eg %h1 # this is an h1 tag
- allow normal Coffeescript (line) comments inside (indented) element body
- support object spread operator (pre and post ...'s?) in all 3 types of attributes
- handle no-value attributes in () and <> attributes (implicit value is true?)
- support haml-style nested object attributes? eg ng: { click: ... } - or is that ambiguous w/ possible object-literal value of top-level attribute?
- handle comments inside object attributes?
- don't wrap string literal object attribute values in braces eg %h1{ a: 'b' } >> <h1 a='b'>, not <h1 a={'b'}>
- support haml-style class and id attribute merging? should also imitate haml wrt other duplicate attributes eg %a( b='c' ){ b: 'd' } >> <a b='d'> (looks like object always wins)?
- should it allow else nested at same depth as = if? eg:
%h1
= if x
%abc
else
%def
- allow haml-style self-closing tag syntax? eg %hr/
- handle inline else eg if x then %a else %b
- handle chain after function glyph eg:
x ->
.y
- handle namespaced (:) element names
- handle elements as attribute values?