Sign up for your FREE personalized newsletter featuring insights, trends, and news for America's Active Baby Boomers

Newsletter
New

You Can Replace Popular Frameworks Using These Methods! ????

Card image cap

TL;DR Of course, I realize that most major websites today are written in them, I'm just offering an alternative.

Hello everyone! Today, so many sites use frameworks like Next.js, Nuxt.js and others that you can't help but think that this is hopelessness, but it's not!

In this article, we will look at the main methods that you can use to create your web applications.

Let's get started!

???? Web Components (Vanilla Custom Elements)

Yes, probably the most trivial solution that comes to mind is to create just components, but without frameworks. Although it is trivial, it is quite effective.

class MyComponent extends HTMLElement { 
  connectedCallback() { 
    this.innerHTML = `<button>Hello World</button>`; 
  } 
} 
customElements.define('my-component', MyComponent); 

In native javascript, of course, there have long been solutions such as the CustomElementRegistry interface, which we can access in the example through the customElements property, or the good old template tag along with it.

This is quite a niche thing today, but nevertheless, it is an officially supported technology, so it will be relevant for a long time and will not depend on any module.

???? Ajax and HTML

The second method, which is becoming increasingly popular today, is getting data from the server directly in the markup. We describe small settings for the request, and the module will receive the components.

<div> 
  {{#request src="/api/title"}}{{/request}} 
  <button data-action="increment" id="btn">Click!</button> 
  <div> 
    Clicks: {{#request src="/api/clicks" after="click:#btn"}}{{/request}} 
  </div> 
</div> 

The big advantage of this method is that we can take the components to the server and reuse them regardless of the domain. Also, such constructions are quite lightweight. In the example, HMPL syntax was used.

???? Check out HMPL

????️ CMS

This is the most ancient method and today many developers no longer consider it, but its benefits for business are undeniable - this is a Content Management System.

No matter how far web development has advanced, people will still use WordPress and other similar platforms even in 20 years, because it is convenient and provides many ready-made solutions for business.

???? Check out WordPress

???? Static site generators

Also an ancient, but still relevant way of creating a website. Here, it is great for creating blogs or documentation, when we do not work with content from users, but only show static data.

As an example, of course, we can cite Jekyll - this is probably the most popular tool for creating static blogs designed for web 1.0 design, but nevertheless, it is also a cool way to create a site. Example of code on Jekyll:

--- 
layout: default 
title: Home 
--- 
 
# Welcome! 
 
This is the homepage of my Jekyll website. 
 
## Latest Posts 
<ul> 
  {% for post in site.posts %} 
    <li> 
      <a href="{{ post.url }}">{{ post.title }}</a> 
      ({{ post.date | date: "%m/%d/%Y" }}) 
    </li> 
  {% endfor %} 
</ul> 

Yes, most content is generated via Markdown, so this method is suitable for what I wrote earlier.

???? Check out Jekyll

✅ Conclusion

Yes, frameworks are not a panacea today. Website development is good because it allows you to choose a wide alternative between creation methods. If a tool supports compiling code into ready-made HTML, it is already suitable. And it does not matter what language it is written in, even Rust, or something else. Therefore, choosing a method specifically for a task is easier than ever today.

What do you use in your projects instead of a framework? It will be interesting to know in the comments ????!

Thank you for reading the article ❤️!


Recent