DEV Community

Discussion on: What would the ideal web framework look like?

Collapse
 
ravavyr profile image
Ravavyr

I have to ask, why must it be "compiled" ?
What's the benefit?

Like, if i write an email, i don't want it processed and rewritten if my english is good enough to convey the exact same message.

HTML and CSS make the frontend skin and bones There is zero reason for this to be compiled when it should carry no logic.

Javascript adds functionality to this skin and bones, i can see compiling it to play nice is a good idea, though most browsers now understand javascript well so there's no longer a need to make it play nice, it just plays already.

Also, rendering flat HTML out is no longer necessary. Google can index Javascript sites/applications. The other search engines should catch up. Bing can do it some, and DuckDuckGo just copies Bing's results, so i'd say that covers like 99.9% of the western markets [i don't really deal with Yandex or Baidu to know about them]

So I do want a good response on "Why must it be compiled?"
This isn't programming, it's web development.

Collapse
 
siddharthshyniben profile image
Siddharth

"Compiled" as in "converting structures which aren't actually valid HTML/CSS/JS into HTML/CSS/JS, possibly optimizing the code on the way". Like Svelte

Thread Thread
 
ravavyr profile image
Ravavyr

HTML and CSS are fairly straightforward languages.
Perhaps writing valid HTML and CSS leads to devs being more detail oriented.
We have practically a dozen free tools to validate your HTML and CSS if you're not sure it's good.
Learning write HTML and CSS in a different syntax/format to then have a compiler convert it back to proper HTML/CSS makes ZERO sense.

JS is more complex, but again we can do it all with vanilla JS. Svelte is just another iteration of what Angular/React/Vue etc started. You're learning another syntax and when things break you have to debug it "for svelte" instead of writing Javascript and debugging Javascript. [There's a long rant attached to this, but we CAN build full complex websites using only vanilla JS and it really doesn't take nearly as much effort as some would have you believe, plus you can debug all of it because it's just JS]

Thread Thread
 
siddharthshyniben profile image
Siddharth

I'm guessing I wasn't that clear 🤦. By compiling HTML I mean compiling stuff like two way binding, components, and other stuff which may be valid HTML but won't render as you like.

We definitely can build complex websites with Vanilla JS. Frameworks just make it a bit easier (and more maintainable) for us.

Collapse
 
joas8211 profile image
Jesse Sivonen

I'd like to split up parts of the webpage to different files that contain all the needed code for that specific component so that the code base is more structured and I can reuse the components. Sure it's possible to do components without JavaScript frameworks, but including the components is a chore and making them work in every scenario is difficult. Not even talking about configurability of the components.

Thread Thread
 
ravavyr profile image
Ravavyr

Components are tricky and can be complex, but we still don't need large frameworks to support them.

I wrote taino.netlify.app in under 30 hours about 2 years ago just to see what the least amount of JS needed is to build SPA websites. The core code can be used to make a 10 page blazing fast site in hours covering like 90% of websites. It's 13kb uncompressed and requires no npm installs, runs as a static site on any service like netlify/heroku/aws S3/digital ocean apps etc.

Since then i've used it on a few small test project and a proof of concept turned into a full scale product indiegameshowcase.org

So frameworks and compiling are really overkill for the web. I fully understand why Google and Facebook need them. With thousands of devs working on platforms processing a trillion requests a day...yes, go all out with code structuring and enforcement of standards.

For the every day dev making blogs, small ecomm, business brochure sites....there is no reason at all we should be using these bloated tools, unless you want a FAANG job I guess, which isn't the worst thing in the world. I just want people to know there are simpler options.