News for hackers. Stuff that matters.
Re:Nue.js: Rethinking Reactivity by meiraleal on Monday October 02, 2023 @05:18AM (#37735765)
for me surprise, count=0 is indeed ES6. I thought const, let or var was mandatory but it seems to not be.

On VueJS case tho the count=0 is misleading as it is a class variable that can get a setter and getter but in Nue.js code it is a normal variable that can't have a getter/setter. So the code doesn't really do what it is supposedly doing.

Re:Nue.js: Rethinking Reactivity by tipiirai on Monday October 02, 2023 @05:29AM (#37735870)
Sorry, which code?

If you want getters and setters, you'll use standard ES6

Re:Nue.js: Rethinking Reactivity by meiraleal on Monday October 02, 2023 @05:44AM (#37735990)
> Sorry, which code?

a normal "count = 0" used in the examples.

a Nue "count = 0;" isn't the same as a ES6 "count = 0;". It needs compilation. I think trying to convince developers of the opposite won't help much grow a community.

Re:Nue.js: Rethinking Reactivity by tipiirai on Monday October 02, 2023 @08:11AM (#37737117)
When a Nue component is compiled it creates a native ES6 class directly from the contents of the inner script tag. The ES6 code is not traversed at all, let alone altered. That is: count = 0 is a native ES6 class instance variable.
Re:Nue.js: Rethinking Reactivity by meiraleal on Monday October 02, 2023 @10:08AM (#37738354)
where is the class instance in count = 0?

It is implied, it will be supplied by the framework after compiling the code. So no, it is not a ES6 class instance variable.