Let's take a look at the Jamstack,

the architectural approach that makes your websites faster, safer, cheaper, and all that with a better developer experience.

🧵🔽
1️⃣ What Is It?

The Jamstack is an architectural approach.

The letters "J A M" are an acronym and actually stand for:

▶️ JavaScript
▶️ APIs
▶️ Markup
🟢 JavaScript

JavaScript is the universal runtime of the web. Every browser can handle JavaScript and it's the language that brings interactivity to every modern-day browser.

JavaScript can either be written directly or act as a compile target.
🟢 APIs

More and more APIs are created every day. Take Stripe for example. They offer an API to process payments for you. It is designed to be integrated into other projects and doesn't offer a fully-fledged frontend like Paypal does, for example.
🟢 Markup

The web is made up of markup. HTML is THE markup language of the web. Every website contains HTML that is rendered by a client's browser. Without HTML there wouldn't be websites.
Next to its basic building blocks, the Jamstack embraces a few core principles, some of which are:

▶️ pre-rendering
▶️ decoupling
▶️ (Nearly) everything lives in git
🟢  Pre-Rendering

Traditional approaches work as follows (approx.):

Your browser sends a request to a server. The server fetches data from multiple data sources and starts rendering HTML from a template while filling in the data. It then sends back an HTML document which ...
... your browser parses. If it encounters additional resources like stylesheets, JavaScript, and images, it sends more requests to the server and fetches that data, as well.

When everything is fetched (at the latest) your browser can finally render the full page.
Although it doesn't take into account that some resources can be fetched asynchronously while the rendering already takes place. This pretty much sums up traditional approaches.

The Jamstack optimizes this process by moving some time-intensive tasks from the run time to the ...
build time. Instead of fetching data each and every time a user sends a request, the data is fetched once, at build time. This data is then rendered into a static HTML page which, once deployed, can be served to each and every user requesting it.
🟢 Decoupling

Traditional approaches have tightly coupled stacks. To actually be able to create HTML at runtime, you need business logic and logic which accesses the database. This creates a relatively tight coupling.
This approach also resulted in the creation of the full-stack developer. A developer that can build such an application and write frontend, as well as backend logic.

When built with the Jamstack, the project focuses on the frontend. It is a fully separate application ...
... that accesses already existing APIs and data sources. It puts the focus on the frontend work while optimizing the outcome heavily.

And what's served later is served as fast as possible. A benefit for users and search engines. Both value speed pretty high these days.
🟢 (Nearly) everything lives in git

Git is one of the (if not the) most-used version control management tool(s) in the world. Most source code is already tracked by git and enables atomic deployments from a tag or a commit hash.
Adding your website's data to it simply makes sense. One commit does not only contain the structure and functionality of your website at one certain point in time, it does now also contain its state and content.

A commit now contains the one article you published under this ...
... hash, and when you go back one commit, this article is gone again. If you wanted to revert your page to this exact state, you can simply revert the state of your git repository.

This streamlines the process by a lot. No more reverting git state, ...
... then reverting the database, and so on...git is the only master of truth.

A change in your repository triggers a new build. This build, when finished, leads to static files. Those are uploaded to the content delivery network which invalidates its caches ...
... and then serves the updated version.
2️⃣ How Does It Work?

You've already read about some of the principles of the Jamstack, but to give you a sum-up of how it works:

Sites are pre-rendered by a static site generator. At build time, data is fetched from multiple sources and rendered directly into static pages.
Assets like images and resources like JavaScript are optimized and placed into the HTML document. The static files are then usually deployed to a content delivery network that keeps your site as close as possible (geographically) to the user while also leveraging caching.
At runtime, existing APIs can be used to enrich the overall user-experience. This means that features like commenting on articles, making a payment, or liking a post can still be handled dynamically at runtime, but everything that can be served statically otherwise, ...
... is served statically to reap the benefits of increased speed, ease of use, and so on.
3️⃣ Conclusion

The Jamstack is an interesting approach. Its concepts aren't new but due to the rise of the cloud and content delivery networks in recent years, many of them actually became possible on a large scale.
There are many service providers nowadays, that give you the basic infrastructure building blocks to base your net Jamstack project on. Netlify, Vercel, even AWS. These are only some names of larger players in this field.
Frameworks like Next and Gatsby or tools like Hugo streamline the experience for developers and let you use the skills you already have to get building.

So, are you already using the Jamstack? Do you plan to use it? What do you think?

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Oliver Jumpertz

Oliver Jumpertz Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @oliverjumpertz

25 Mar
Svelte has topped the satisfaction rankings of "State of JS 2020" some time ago, and this justifies an introduction for everyone still not aware of it.

An introduction to Svelte 💛

🧵🔽
1️⃣ What is Svelte?

Svelte is a component-based frontend framework like React and Vue, that promises:

- Less code
- No virtual DOM
- True reactivity

and delivers on all of these pretty well.
It currently has 41.2k stars on GitHub and an active community, including 359 contributors.

The community is pretty active and unlike React, there is no huge corporation backing it.

But no need to worry, Svelte won't vanish anytime soon.
Read 16 tweets
23 Mar
Here are _some_ of the most essential git operations you will need when working as a developer.

🧵🔽
1️⃣ Create A New Repository

This is the most basic command you'll need. When you start a repository locally, your start with git init.
2️⃣ Clone A Repository

You can clone a remote repository to get a local copy of it. Your local repository is connected to the remote one so you can pull in changes and push yours to the remote.
Read 15 tweets
22 Mar
Test-Driven Development

You hear some people talking about it, you might have a basic idea, but let's take a closer look because, in the end, it's not as difficult as it might seem from the outside!

🧵⏬
1️⃣ What Is It?

Test-driven development (short: TDD) is a software development technique.

Instead of writing all your code first and only then writing your tests, you start with tests, then code a little, then test again, and so on.
It is one specific form of the test-first approach and aims at making software development faster, more reliable, and safer to do. And it especially forces developers into a user role.

By writing tests first, you become a user. You are the first one to ...
Read 26 tweets
21 Mar
So many people say "learn the fundamentals", but sometimes it's difficult as a beginner to even remotely grasp what that means. And that's okay.

Let's talk about it, and let me give you some info on it (from my point of view).

🧵⏬
1️⃣ What Actually Are Fundamentals?

Fundamentals are concepts, and maybe even techniques, that you can apply in multiple areas and multiple programming languages.

They are not tied to anything specific and are sometimes pretty theoretical.
All in all, they are the foundation you can base more specific knowledge on.

All programming languages build on those fundamentals themselves and give you a very specific way to work with them.
Read 30 tweets
20 Mar
JavaScript keeps evolving every day, and there are many proposals currently in the pipeline that are going to make JavaScript even more awesome! 🔥

We'll take a look at one proposal that is currently in stage 2 and is going to bring native immutability to JS!

🧵⏬
1️⃣ The Records & Tuple Proposal

This proposal introduces two new types to JavaScript, namely Record and Tuple.

They are designed as compound primitives that can contain other (compound) primitives.

github.com/tc39/proposal-…
They are both deeply immutable, so you no longer need to Object .freeze() your objects or use libraries like Immutable .js to gain unchangeable objects, and do you know what's even more awesome?

You can compare them with the strict equality comparison (===), ...
Read 18 tweets
19 Mar
Why is Rust interesting for WebDevelopers?

One (combined) word: WebAssembly!

🧵🔽
1️⃣ Why Is This Interesting At All?

WebAssembly has the chance to become for JavaScript what C, C++, and Fortran are for Python.

JavaScript has its limitations, as well as Python does. Python solves this by having an awesome native interface that allows easy integration ...
... of low-level libraries. JavaScript has C/C++ in Node. But in the browser? Sure, floating-point arithmetics can well be done with the help of WebGL and shader language, but there is no common low-level target for all of JavaScript.
Read 13 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!