The thing I enjoy about frameworks like React is the declarative nature of the UIs. I'd love to not be able to use them and to create complex UIs in pure JavaScript but it always ends up being painful where you spend more time optimising the rendering than doing any work. In simple apps I will write UI in a functional matter in pure JavaScript, regardless of the performance implications. But bigger DOM means worse pe…
i agree it's up to the browsers chromium , Safari , and Firefox to do the diff. But we might need a new meta tag or change to the Fetch API to tell them this html page should only update the elements that are different. Remember . It was discouraged because the back button broke. If you're developing a single page react app, I don't think you care about the back button.
TodoMVC App Written in Vanilla JavaScript
21–30 of 115 posts
Re: TodoMVC App Written in Vanilla JavaScript
#22I'm glad we have frameworks.
Re: TodoMVC App Written in Vanilla JavaScript
#23The thing I enjoy about frameworks like React is the declarative nature of the UIs. I'd love to not be able to use them and to create complex UIs in pure JavaScript but it always ends up being painful where you spend more time optimising the rendering than doing any work. In simple apps I will write UI in a functional matter in pure JavaScript, regardless of the performance implications. But bigger DOM means worse pe…
it sounds sort of wild to expect there to be diffing! why do you have to generate a whole copy of the stuff instead of just telling the browser what changes to make? bonus: the existing apis instead of one that don't exist yet.
Re: TodoMVC App Written in Vanilla JavaScript
#24The thing I enjoy about frameworks like React is the declarative nature of the UIs. I'd love to not be able to use them and to create complex UIs in pure JavaScript but it always ends up being painful where you spend more time optimising the rendering than doing any work. In simple apps I will write UI in a functional matter in pure JavaScript, regardless of the performance implications. But bigger DOM means worse pe…
i agree it's up to the browsers chromium , Safari , and Firefox to do the diff. But we might need a new meta tag or change to the Fetch API to tell them this html page should only update the elements that are different. Remember . It was discouraged because the back button broke. If you're developing a single page react app, I don't think you care about the back button.
Your users likely do, so you should too.
Re: TodoMVC App Written in Vanilla JavaScript
#25Before even considering something like this I’d want to see a style guide and clear definition of where code should live. Frameworks like React do that well. I can expect a random React dev to mostly do similar things.
Re: TodoMVC App Written in Vanilla JavaScript
#26The thing I enjoy about frameworks like React is the declarative nature of the UIs. I'd love to not be able to use them and to create complex UIs in pure JavaScript but it always ends up being painful where you spend more time optimising the rendering than doing any work. In simple apps I will write UI in a functional matter in pure JavaScript, regardless of the performance implications. But bigger DOM means worse pe…
it sounds sort of wild to expect there to be diffing! why do you have to generate a whole copy of the stuff instead of just telling the browser what changes to make? bonus: the existing apis instead of one that don't exist yet.
Re: TodoMVC App Written in Vanilla JavaScript
#27It's older though (seems to have been first written 6 years ago) and has significantly more code.
Re: TodoMVC App Written in Vanilla JavaScript
#28Yeah, that's exactly what I would imagine vanilla js code look like, and I'm glad we moved on to frameworks. Just this small app seems not so fun to maintain
Re: TodoMVC App Written in Vanilla JavaScript
#29I like the "const TodoStore = class extends EventTarget" idea to trigger rendering... neat trick!
Re: TodoMVC App Written in Vanilla JavaScript
#30Why is there HTML inside the JavaScript? Doesn't that defy the entire point of the MVC pattern?