Html First and the Future of Web Apps

Author

Reads 750

HTML and CSS code on a computer monitor, highlighting web development and programming.
Credit: pexels.com, HTML and CSS code on a computer monitor, highlighting web development and programming.

Html First is a design approach that prioritizes the structure and content of a web page, making it more accessible and user-friendly.

This approach is based on the idea that the HTML code should be written first, before any CSS or JavaScript is added.

By doing so, developers can ensure that the content is properly structured and easily readable, making it easier for search engines to crawl and understand.

Html First also promotes a more modular and reusable code, which can be beneficial for large and complex web applications.

For another approach, see: Html Indent First Line of Paragraph

The Rise of HTML-First

Astro is a great example of an HTML-first tool that ships zero JavaScript by default, letting developers opt in only when needed. You write mostly HTML and CSS, and only hydrate components client-side if interactivity demands it.

HTMX is another tool that lets you send HTML over the wire and attach behavior declaratively using attributes. It's elegant, terse and incredibly effective for building interactive apps without spinning up a full JS framework.

A fresh viewpoint: Tooltip with Html

Credit: youtube.com, HTML Tutorial for Beginners

Modulo aims to be much more HTML-oriented compared to other web frameworks. It piggy-backs off of HTML syntax, declaring component parts using HTML tags, within other HTML tags.

Modulo's development workflow starts as a static site of HTML and CSS files, created and edited by hand. Only as requirements grow beyond the common use-cases offered by "canned" CParts does JavaScript come into play.

Modulo exposes itself as an extension to vanilla HTML via the Web Components standard, integrating comfortably with anything that deals with HTML, such as PHP, Django, Rails, and even other frontend frameworks.

Here are the key benefits of HTML-first tools like Astro, HTMX, and Modulo:

  • Speed: They prioritize speed and performance-first architecture.
  • Accessibility: They emphasize accessibility and simplicity.
  • Simplicity: They let developers opt in to JavaScript only when needed.
  • Interoperability: They integrate comfortably with other HTML-based technologies.

These tools represent a cultural shift, recognizing that the web's foundational language, HTML, still deserves top billing.

Understanding the Benefits

HTML-first designs load faster, degrade better, and play nicer with search engines and assistive tech. This means sites become more resilient, maintainable, and enjoyable to build.

You might enjoy: B Tag Html

Credit: youtube.com, How to Learn HTML | Benefits of Learning HTML

Developers are no longer judged solely on features – they're judged on how efficiently those features arrive and behave. An HTML-first approach aligns perfectly with this reality.

An HTML-first approach reduces the barrier to entry for new developers, allowing them to learn the web's building blocks without being overwhelmed by complex configurations or syntax trees.

Why This Shift Matters

This shift to HTML-first designs is more than just a preference, it's a crucial conversation that affects users directly. HTML-first designs load faster.

HTML-first designs also degrade better, which means they work even when things go wrong, and play nicer with search engines and assistive tech. This improves overall user experience.

It's not just about performance, though – HTML-first designs are also more maintainable and enjoyable to build. Developers are judged on how efficiently their features arrive and behave.

The rise of Core Web Vitals as a ranking factor is a key driver of this shift. It means developers are now judged on more than just features. They're judged on how well those features work.

This shift reduces the barrier to entry for new developers. They can learn the web's building blocks without getting overwhelmed by complex configurations and syntax.

Speed of jQuery

Credit: youtube.com, Speed Up Your jQuery Tooltips: An Efficient Solution for Table Cells

Adding behavior to a page with JavaScript increases both network payload and execution time.

Browsers have been constantly evolving and optimizing both HTML parsing and JavaScript parsing and execution.

Web application developers have been struggling for years to provide the most robust functionality with the least code.

HTML-first frameworks provide the best page performance possible by intelligently minimizing the amount of code delivered and executed.

Users have become accustomed to having a website load and be in working order very quickly.

Check this out: Html Parsing in Java

Best Practices for HTML-First

Prefer "naked" HTML to obfuscation layers that compile down to HTML, as this allows developers with familiarity with HTML to understand 90%+ of the code, even if they're not familiar with the backend framework.

Maintain the right-click-view-source affordance, which allows developers to see the code behind the page and remix existing snippets to learn and create new things. This was a gift to aspiring developers in the early web, but has become rarer with the adoption of frameworks like React.

Building Rich Web Applications

Credit: youtube.com, 🌐 JavaScript with HTML: Best Practices for Web Development

eBay's feature-rich interactive website uses Marko, an HTML-first framework that's proven to be effective for complex web applications.

Marko's compiler analyzes the application code to minimize bundle size and deliver them on demand, making it an excellent choice for large-scale projects.

Qwik is another HTML-first framework that's being used for builder.io, a complex, interactive, stateful web application. It's optimized for JS delivery and is definitely worth exploring for high-performance needs.

For public-facing websites, performance should always be a top priority, and if you're not achieving high performance with your current system, it's worth evaluating alternative approaches.

If application profiling and user studies show initial page load and responsiveness are significant issues, then it's definitely worth exploring new options, like Qwik or Marko.

For another approach, see: Html Application

Default to Defining Style and Behaviour without Inline HTML Attributes

Using inline HTML attributes to define style and behavior can be limiting. It voids the possibility for third-party styling, which can be a problem if you want users to have control over the look and feel of your application.

Credit: youtube.com, Why & When to Use Semantic HTML Elements over Divs

Remember the MySpace bug where users could style their profiles with CSS in the profile text fields? That's the kind of flexibility you lose when using inline HTML attributes.

Styling with inline attributes also makes it more difficult for developers to alter the look and feel of your application in the future. Good style classes, on the other hand, make it effortless for anyone to change the design.

It's worth noting that using non-platform-compliant frameworks like Tailwind can make it even more difficult to alter the design. This is something to keep in mind when choosing a framework for your project.

A unique perspective: Using Oembed in Base Html

Maintain Right-Click View Source

Maintaining the right-click View Source affordance is crucial for developers who want to learn from existing code.

This feature allows us to see the code behind a web page, which was a game-changer for aspiring developers. It enabled us to bridge the gap between theory and practice by seeing code and interface alongside each other.

Html Code
Credit: pexels.com, Html Code

For many sites, we could copy and paste HTML or CSS and run it ourselves to get a close-to-identical replica. This practice, known as "remixing", was not only a way to learn but often formed the basis of new creations.

However, the industry has adopted several "improvements" that have made this practice much rarer. For example, if we use React, we cannot hit "View Source", copy the code, and remix it because React has a build step and requires code snippets to be wrapped in a React application.

Sites that follow HTML First principles regain the View Source affordance. In fact, HTML First sites often go one step further by preserving UI interactions when copying and pasting code, provided the destination file includes the same JavaScript library.

This is a significant advantage of HTML First sites, and we intend to leverage this to build an HTML First code snippet library.

Additional reading: Html Canvas Javascript Library

Front-End Frameworks and HTML-First

Credit: youtube.com, What should I learn first? front-end or back-end!

Front-end frameworks have been the norm for web development, but some developers are turning to HTML-first approaches for better performance and user experience.

JavaScript-first thinking has been the dominant paradigm for over a decade, with frameworks like React and Angular becoming incredibly popular. However, this has led to slower performance, steeper learning curves, and a web that caters more to developers than users.

The pendulum has swung too far, and apps are now breaking without JavaScript, with pages rendering blank until hydration is completed. This is not what we want for our users.

HTML-first frameworks are making a comeback, and they're preserving the benefits of modern front-end development while also providing excellent performance.

Modern HTML-first frameworks like Marko and Qwik are aggressively pursuing the approach of optimizing JavaScript delivery and execution. Marko's compiler analyzes the application code to minimize bundle size and deliver them on demand, while Qwik breaks up an application into very small chunks, often as small as a single function, allowing for on-demand loading and smart preloading.

You might like: Html End Tag

Credit: youtube.com, HTML Full Course - Build a Website Tutorial

This approach is not just about performance; it's also about creating a better user experience. With HTML-first frameworks, we can create applications that are fast, interactive, and accessible.

Some popular HTML-first frameworks include Astro, 11ty, and Fresh, which use the "islands" approach, where portions of the page are static HTML and portions are interactive apps developed in frameworks like React or Vue.

Progressive enhancement is another old technique that's making a comeback, providing a working page with HTML from the server and enhancing functionality client-side with JavaScript.

These frameworks are not just about performance; they're also about making web development easier and more maintainable. With HTML-first frameworks, developers can focus on building great user experiences without sacrificing performance.

Relearning and Adapting

Developers need to relearn how to write semantic, accessible HTML that communicates structure and intent clearly to both browsers and assistive technologies.

It's not about abandoning your hard-earned skills, but about rediscovering the web's original intent. HTML-first forces developers to think about architecture, delivery, and performance from the start.

Credit: youtube.com, HTML & CSS Full Course - Beginner to Pro

To adapt to the HTML-first philosophy, you need to know how to use HTTP verbs like GET and POST, and lean on server-rendered responses to handle state transitions instead of offloading everything to the client.

You should also learn how to use CSS capabilities like transitions for animations, media queries for responsive layouts, and container queries for component-level responsiveness, avoiding JavaScript when native solutions suffice.

Developers should design interactions around forms and navigable URLs, enabling better fallbacks, shareability, and reduced frontend complexity, rather than relying on encapsulated shadow DOMs or routing via APIs alone.

By embracing these changes, developers can create more intentional and performant web applications.

Conclusion and Future

The future of frontend development is shifting towards a layered approach, where HTML is the foundation and JavaScript is used judiciously to bring the page to life.

Frameworks like React, Svelte, and Vue are evolving to work alongside HTML, rather than replacing it. This means that developers can still use these tools, but they should be used as enhancements, not the base of the project.

Learning the basics of the web APIs and CSS is essential for gaining knowledge that will remain relevant for years to come.

Curious to learn more? Check out: The Html Canvas Element Is Used to

The Future Is Layered

Close-up view of HTML and CSS code displayed on a computer screen, ideal for programming and technology themes.
Credit: pexels.com, Close-up view of HTML and CSS code displayed on a computer screen, ideal for programming and technology themes.

Frameworks aren't dying, they're evolving. They're becoming enhancements, not foundations.

We're witnessing the adulthood of JavaScript, where it learns to lead and follow. It's not trying to dominate the stack anymore.

HTML will structure your page, CSS will paint it, and JavaScript will bring it to life - carefully, precisely, and only when needed.

Conclusion

Learning the basics of HTML, CSS, and web APIs is essential for web development, especially if you want to gain knowledge that will last for years to come.

MDN docs and w3schools are excellent resources for learning the web platform, with good documentation that can help beginners get started.

As a web developer, I can attest that having a solid foundation in web basics makes my life more fun and allows me to effectively use tools like htmx and Tailwind.

Using tools like htmx and Tailwind can enrich your workflow and make development more enjoyable, but only if you have a good grasp of the basics first.

I personally appreciate the improvement of w3schools in recent years, but still recommend MDN docs as a top resource for learning the web.

A fresh viewpoint: Html Tools R

Calvin Connelly

Senior Writer

Calvin Connelly is a seasoned writer with a passion for crafting engaging content on a wide range of topics. With a keen eye for detail and a knack for storytelling, Calvin has established himself as a versatile and reliable voice in the world of writing. In addition to his general writing expertise, Calvin has developed a particular interest in covering important and timely subjects that impact society.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.