What I don't get in all these frameworks is the desire to invent new and incompatible template languages with increasingly inane syntaxes. Oh. And, of course, with stringly-typed programming and magic binding rules.
const counter = new Counter({
data: {
count: 99
}
});
...then {{count}}, or counter.get('count')
Why is it `counter.get('count')`? WTF?
Or just the section on computed properties[1]: oh, it's no longer even Javascript. It's some magic Javascript-like scripting language that gets injected with properties based on what you write. Much like in Vue data, properties, and methods are magically hoisted up to the object breaking everything you learned about Javascript:
export default {
methods: {
say: function ( message ) {
alert( message ); // again, please don't do this
}
}
};
// and then
import MyComponent from './MyComponent.html';
var component = new MyComponent({
target: document.querySelector( 'main' )
});
component.say( '' );
I’m not an expert can I can chime in and say that .get and .set are common in Ember data objects as well. No idea if it’s an ES6 thing or Ember thing though.
Those are Ember-specific, because ES getters and setters weren't widely available at the time of introduction. They just dropped < IE 11 though so they'll start to go away.
Comments (209) 32 threads
Show all comments
Showing thread 11 of 32
Just look at Svelte's templates: https://svelte.technology/guide#template-syntax
Why is it `counter.get('count')`? WTF?Not only it's some custom implementation, it also breaks all assumptions about javascript code
Or just the section on computed properties[1]: oh, it's no longer even Javascript. It's some magic Javascript-like scripting language that gets injected with properties based on what you write.
Why the hell is `.say` a top-level method now?Much like in Vue data, properties, and methods are magically hoisted up to the object breaking everything you learned about Javascript:
And so on and so forth.
[1] https://svelte.technology/guide#computed-properties