-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Reason behind spinning up a new UI framework #56
Comments
Well this is a big question.. First thing first, the gridsound's code is 20 000 lines in total composed by:
I didn't recode any framework but i've coded a compilation of vanilla components. This is really different. Even if i took a framework at the begining i would have to do all the components needed by myself (except maybe few, you have talked about the windowing? which package are you talking about?) I will say the only advantage i see to use a framework, it's consistency. However i see 3 reasons to not use a framework. The main one is because angular/react/vue and the unnamable css-in-js concept are not standard. The second reason is the fact that react/vue itself (cf. without npm packages) will helps you to do simple things faster yes, but will slowdown your process at the moment of doing more complex mechanics. The third reason is that i give to gridsound a longer lifetime estimation than react. What will happen when Facebook will see that nobody use IE11 for the web anymore (and not only for intranets somewhere)? They could redo their entire websites with standard and faster code. Then they will drop the support of react. React will lose its hype and this will be the real technological debt because no new engineer will want to work on a deprecated technology. For all those reasons plus the fact that i knew all the fundamentals of JS/CSS i chose to go on the native vanilla path. Thanks for your curiosity and your interest :) |
Great project! Is lit-html being used or has it been considered? It's a very performant, lightweight, non-framework template/rendering library that could augment the current vanilla path while giving massive performance boosts. Leveraging Incrementality for Faster Web UI is a good video to watch to see the perf benefits (lit-html can be used without lit-element (W3C Web Components)) |
Hi :) thx for your interest I understand the solution of lit-html/element but i don't understand the problem. They say they don't do VDOM diffing, but they have still to do diff on data or on the string or idk what, but they have to call some functions, some loop, use some ifs etc. It's written that only what's change will be updated, that's great but what is the other scenario? Why some people would update some HTML if there is no change? setInterval( () => {
document.body.innerHTML = `all the app`;
}, 1000 / 60 ); All the data that have to be changed has some ID or are in a liveNodeList somewhere etc. all those library/framework try to be optimized like if you did it by hand. I see in the lit's code |
Where is the problem of doing something like this : class MyComponent {
constructor() {
this.elRoot = MyComponent.template.cloneNode( true );
this.subElement = this.elRoot.querySelector( ".MyComponent-subElement" );
this.subElement2 = this.elRoot.querySelector( ".MyComponent-subElement2" );
this.subElement3 = this.elRoot.querySelector( ".MyComponent-subElement3" );
}
open() {
this.elRoot.classList.add( "MyComponent-open" );
}
close() {
this.elRoot.classList.remove( "MyComponent-open" );
}
}
MyComponent.template = document.querySelector( ".MyComponent" );
MyComponent.template.remove(); It can't be more optimised right? so what is the problem? is it not readable enough not maintenable enough? A mistery. EDIT: i just though that many people think if we don't use react then we have to recode react, so, do you think the code above is a framework? |
I am afraid to look as someone toxic, i'm really not, thanks you to propose me some concept, some ideas, i'm really thankful I considere this issue here as a technical debat ^^ then i'm sharing with you the fact that i'm annoyed to never see the opposite arguments on these tech pages. You send me a video of Google, they are probably the best web devs in the world, and they are saying to us (devs outside of GAFAM) that we are not oblige to update all the DOM? How Google was coding their Google Sheet before the framework era? are they saying when you edit one cell the entire app is redraw? no obviously not. Then how were they doing it? it's looks like they think that if you are not at GAFAM already then you can't code like them. And it's on the MDN that i've found the custom element (or web element like you said), and this is where i would like to go, for 2 reasons:
|
My apologies, I didn't mean to suggest that any particular problem currently exists. I personally try to avoid frameworks myself. Just came across this GitHub issue and wanted to recommend lit-html if anyone was interested. I personally like to use A/B performance tests before choosing something new, but lit-element's async rendering with Promises could potentially be useful in certain situations. I do know that it takes advantage of the new |
No need to you to be sorry, it's on me i'm too direct on this subject, i have many things to say/ask... But i have to admit, lit-html looks a lot more like a library than a framework you're right. And by framework i mean also React, they sale it as a library but i've never see anyone doing more than one I have read several lit's example to see how it's works with DOM events, this looks cool, i understand why you wanted to propose this. But i still think we should not mix HTML with logic, so i don't feel the need to have the template really inside the code. Also would it be possible to send back to lit only what have changed? imagine if in the template there are an A and B text values, do i need to pass A and B each time even if only one of theme has a new value? A/B performance tests sounds great, how do you do that? How can we be sure the browser will not find a pattern to optimized when we call 10_000 times the same code in a loop? I love those questions but sadly the frameworks have moved the debat from what is fast for CPU to what is fast to code. Anyway here the main problem is still the recalc/redraw, it's the reason why i've made the UI's FPS flexible and this makes change the CPU % drastically. |
Hi @mr21, these are just my two cents on this topic:
Doing it by hand
While I admire your hands-on DIY mentality, I (as a possible contributor) would not start to learn something that I can not reuse in other projects, be it commercial or private. For closed-source one man projects (like eg. photopea) this is perfectly fine, but for open-source software (and such a cool one ;)) and the sake of collaboration, I (personally) would try to be highly standardized. What would I do? Just my thoughts on that topic :) |
Has there been specific needs or other reasons on why you decided to create a new UI framework from scratch rather then using something like VueJS or React that already provide a lot of functionality by third party packages (like windowing)?
The only reason I could think of would have been performance, seeing that a lot of the code is written in an "older-styled" way. I am just curious :)
Have a great day!
The text was updated successfully, but these errors were encountered: