Two-way props! Yikes! That was a mess in the first version of Angular. I thought the consensus was that two-way props binding just opened the door to difficult to understand side-effect laden code.
The bindings in Gea work just like in JavaScript. Two-way if an object is passed, one-way if a primitive is passed. I think it's best to stick to the idioms of the underlying language.
JavaScript Is Enough
31–40 of 110 posts
Re: JavaScript Is Enough
#32Earlier quoted context omitted.
The bindings in Gea work just like in JavaScript. Two-way if an object is passed, one-way if a primitive is passed. I think it's best to stick to the idioms of the underlying language.
I don’t know if I’d call it an idiom — rather I’d argue that in modern JavaScript, mutating passed objects is often an anti-pattern.
And in the end in Gea developers have full control over this, just in the same way they do in real life. `child({ ...obj })` easily solves this, for example, in both idiomatic JS and in Gea.
Re: JavaScript Is Enough
#33Re: JavaScript Is Enough
#34Re: JavaScript Is Enough
#35Re: JavaScript Is Enough
#36hey! Great job on this, dashersw. I‘ve believed for a while now that the compile time dependency analyzer approach is the only good way for frameworks like this. Really neat choices on the API surface as well – so simple! Launching with a headless UI lib is smart. will try both in a side project soon! thanks and cheers!
Re: JavaScript Is Enough
#37Re: JavaScript Is Enough
#38How does this thing run so close to VanillaJS without carrying any extra baggage along for the ride?
One thing I borrowed from my earlier library erste is event delegation. Instead of creating event handlers bound to each DOM element (say, in a list render) which is memory-heavy and also consumes a lot of CPU cycles, Gea simply attaches one event listener per type on the body and uses a `.matches()` call to check whether that event applies to a given DOM element. This is one of the main reasons why Gea is so performant—there's no excess/unnecessary memory allocation or CPU cycles. This is also reflected in the benchmark results.
Re: JavaScript Is Enough
#39React is just JavaScript. Also vanilla JavaScript is just JavaScript
Vanilla JS, on the other hand, requires a good knowledge of DOM APIs.
Gea tries to be as close to plain old JavaScript as possible, the way we write it on the backend. The only necessary notion is that everything is reactive and DOM will update automatically as component/store members change.
Re: JavaScript Is Enough
#40Not a JS dev but the site need to move away from tinted retro look if you want to stress the modernness.
Thank you! It's the author here. I thought hard about this, and one angle Gea is bringing is that the old is new again, that's why I harkened to a retro style. I also just plain love synthwave, so... :) but you are right, and as Gea matures I believe we will iterate on the homepage.
Great framework tho. Awesome job.