DEV Community

Cover image for What would the ideal web framework look like?
Siddharth
Siddharth

Posted on

What would the ideal web framework look like?

It seems like every week there is another ground-breaking new web framework. Some of them are interpreted, some compiled. Some of them are based on HTML tags, some component driven, and so on.

So, what would the "ideal" framework look like, maybe using ideas of existing frameworks? Of course, no framework is perfect for use everywhere, but what would come close?

Latest comments (58)

Collapse
 
pontakornth profile image
Pontakorn Paesaeng
  • Component
  • Have their own sensible and convenient template system
  • Still support JSX
  • Have strong TypeScript support
  • Have official debugging tools
  • Have official support for editor
  • Easy integration with other tools

Vue is the closest to my ideal now.

Collapse
 
siddharthshyniben profile image
Siddharth

I would also prefer something like this, except no Virtual DOM.

Collapse
 
martinkavik profile image
Martin Kavík

Hi, if you like Rust, try to look at MoonZoon.rs. Not production ready yet, but you can find ideas and docs in its readme and there are working examples in the repo.

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao • Edited

Something that gets things done without too much learning curve that is coupled with design software like Xd & Figma for you to translate from design to code.

Without installing a bunch of libraries just to get started. Adopting modular approach using WebAssembly as their core package management is really a good start so anyone can use the compiled modules and adopt it into their website for different purposes.

I come from a django/flask background so I really like 1 way to do things to get started while adding more functionality when you need more stuff.

Collapse
 
gsriraj profile image
Sriraj G

Solid js is heading in the right direction. Though webcomponents would be future proof. Frameworks like lit and stencil do this pretty well. Personally I am looking for an easy to integrate web assembly framework.

Collapse
 
filipslezak profile image
FilipSlezak

For me, Angular with faster hmr, build times comparable to vite.js and support for framer-motion. That should do it for me.

Collapse
 
ca0v profile image
Corey Alix

Silverlight

Collapse
 
cjsmocjsmo profile image
Charlie J Smotherman

I have recently been exploring flutter/dart

It's not html, it's not css, it's not javascript, but it makes for beautiful pages.

What I find most appealing is write once compile to web, desktop or mobile

If you want to try something different (and it is very different) have a look.

Happy Coding

Collapse
 
alaindet profile image
Alain D'Ettorre

I would say the closest is Angular. It lacks the better performance and smaller bundle size and more 3rd-parties of other solutions, but it has an amazing philosophy, ease of development and general stability which would really justify some more support from the community instead of pure hatred.

You have mandatory TypeScript and RxJs and first-party packages for routing, fetching and forms, which is pure gold. The rest is meh and should be improved.

Collapse
 
siddharthshyniben profile image
Siddharth

Angular is especially awesome when you scale , but it's not the best for small apps.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Ideally, a framework should:

  • be very modular
  • be lightweight
  • not replace JS with custom syntax
  • provide state management tools that scale beyond a to-do list
Collapse
 
peter_brown_cc2f497ac1175 profile image
Peter Brown • Edited

There is no ideal framework. Be a good engineer that is properly trained and good things will come

Collapse
 
efpage profile image
Eckehard

Could you imagine a web without HTML? A framework that works on the DOM directly could be much smarter than what we see today. The Document Makeup Library (DML) is one first step in this direction.

Collapse
 
siddharthshyniben profile image
Siddharth

DML sounds interesting, but writing a whole lot of JavaScript would feel weird.

Collapse
 
efpage profile image
Eckehard • Edited

No, DML is VERY different.

You do not write too much Javascript. As an example, the DML-homepage was set up using only two short HTML-pages. Each page contains about 100 lines of project specific Javascript-code, no HTML, only very few CSS. Behind the scenes you can use some libraries that do the work for you. So, the whole site with numerous pages was created using markdowns, the content is build dynamically after page load. All the routing is done dynamically while the page content is loaded.

Why do I call this a "framework"? Because it contains everything you need to build a web page or a SPA.

There are lot´s of examples on dev.to that show, that sources usually are very short.

This may server as an example:

HTML

<ul>
        <li>Coffee</li>
        <li>Tea</li>
        <li>Milk</li>
</ul>    
Enter fullscreen mode Exit fullscreen mode

DML

ul(["Coffee","Tea","Milk"]);    
Enter fullscreen mode Exit fullscreen mode

But the approach is far more powerful than you can see from this few lines. Instead of building pages "by hand", you let Javascript do the work. Want to create 10000 buttons? Just write a loop to do the work:

for (let i=0; i<10000; i++)
    button("I am button Nr. "+i).onclick = () => alert("This was button Nr. "+i)
Enter fullscreen mode Exit fullscreen mode

Voila! with only two lines

  • you created 10000 buttons
  • you added some individual text *"I am button Nr. ..."
  • you created 10.000 individual event functions that display, which button was pressed

One library and a text editor is really all you need.

You think, 10000 functions may be too much, can we save some memory?

function doAlert(e){ alert(e.srcElement.textContent) }
for (let i=0; i<10000; i++)
   button("I am button Nr. "+i).onclick = doAlert
Enter fullscreen mode Exit fullscreen mode

ok, this was three lines of code, but only one alert function for all buttons.

You will need to learn Javascript, but it is the only tool you will need. This pays back very soon!

Collapse
 
jankapunkt profile image
Jan Küster

I would love to see an exhaustive official standard library as in other languages

Collapse
 
lexlohr profile image
Alex Lohr

The ideal framework for me doesn't get in the way and has just enough tools to get the job done, supports tree shaking, has the performance of hand optimized code, foregoes needless abstractions, provides an enjoyable developer experience and doesn't fill node_modules with a GB of dependencies. It basically consists of manageable reactivity and JSX as a template language (because of the superior tooling). Also, it would be free and open and supported by a welcoming and friendly community.

Only a few weeks ago, I found Solid.js and it seems to be as close to this as it gets.

Collapse
 
afif profile image
Temani Afif

The best framework for me is "no framework". Nothing beat writing things from scratch.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Yea, nothing beats running your own code on the silicon you've mined with your own hands... 😝

Collapse
 
renanlazarotto profile image
Renan "Firehawk" Lazarotto

The ideal framework would be one that doesn't try to put web technologies into everything. Ideally, web frameworks should stay web frameworks. Electron, React Native, stuff like that doesn't make sense to me - why reuse a web-language to do non-web stuff? Just because we can?
Now, sticking to the web, anything that doesn't rely on node_modules (or better - that doesn't rely on the Node way of doing things) at all, no bundling, with the minimal tooling possible. Just plain JS files that you can drop into your HTML files and be good to go.
Seriously speaking, front-end development is a nightmare. Even the so-hated PHP is a better language to work with (for me) because it is so much simpler!

Collapse
 
siddharthshyniben profile image
Siddharth • Edited

The ideal framework would be one that doesn't try to put web technologies into everything.

We reuse a web-language to do non-web stuff because nobody wants to learn a whole new language and maintain a different codebase for non-web stuff like apps.

nything that doesn't rely on node_modules (or better - that doesn't rely on the Node way of doing things) at all, no bundling, with the minimal tooling possible

While the no-node way is easier, it's not very flexible. You can't have multiple file components, or stuff like that. If you need those, in the end you will have to compile it.

Collapse
 
frontender profile image
Frontender

He is talking about Javascript frameworks that work on user interface not desktop or mobile apps