Lots of good options here. Personally I think the eval
concept may be too magical. Having these context-less, declaration-less variables may offer the cleanest syntax, but any Javascript developer will be left scratching their head. It’s just not how Javascript works. For people who prefer that level of terseness and magic, there is emberscript.
The option to specify {name: "user.name"}
is great. I think it should be optional in all cases though. In other words, it shouldn’t be a requirement to access nested properties. If you are observing user.stats.age
, I see no reason why user
(or p.user
) couldn’t be a sparse object. You get what you ask for. If you need the full user object, it’s available via this.get()
.
Great job so far everyone, particularly @gunn on the initial concept and implementation! Excited to see where this is headed… even more excited for ES6 to eventually make this moot.