Open nazar-pc opened 6 years ago
Need to think about this one a bit. In the meantime, here's a question: what should {'foo-bar'}
compile to?
{'foo-bar': foo - bar}
{'foo-bar': fooBar}
{'fooBar': fooBar}
I'd say it should literally expand to {'foo-bar': foo-bar}
and compile to {'foo-bar': fooBar}
. I you need camelCase key you can write it explicitly using the same syntax and the first option doesn't follow current syntax in LiveScript regarding hyphens.
Possible outcomes that I see:
{foo-bar/}
-- a mirror backslash string ^_^)I know there are more features, other than this one, which would be nice to modernize, but wouldn't be backward compatible. Maybe we should list them and discuss what to do with them?
I'd vote to a major version bump just to make sure everyone reads a changelog. There is really nothing to be afraid in a major version change, especially if breaking changes are not groundbreaking, but just some nice improvements.
In that case I would like to add some modernization proposals, to include in such version. I'll pitch them soon.
I'm working with Google Closure Compiler lately and sometimes need to return objects for external consumption. In order to prevent Closure Compiler from mangling object keys I need to use strings like
{'key': value}
instead of{key: value}
.Would be nice if LiveScript supported compiling this:
To this:
Otherwise some parts of the code become verbose very quickly.
Currently it would compile to:
Which makes sense, but is not so useful.
Non-obscure syntax alternatives that don't break BC would be nice too.