Here are two ways to build a site (abstractly) that feel diametrically opposed to me:
- Build a site as an SPA (Single Page App). The page loads a skeleton HTML page that executes JavaScript as quickly as it can. The JavaScript calls an API to get data, and then the page renders content. Navigation of the site is more API calls to get the data it needs and re-rendering.
- Build a site as statically-generated. A build process runs in which the entire site is built out as static HTML files with all the content baked into them. JavaScript isn't required at all for the site to work.
That feels just about as different as can be. But weirdly, they kinda aren't:
- They are both JAMstack. They can be hosted statically as neither of them needs backend languages running on the server they are hosted on.
- They are both building content based on an API of data. It's more obvious in the first one, but you can think of a static site generator as hitting an API of data as it runs and builds itself. It's just that the API might be temporarily created from content files it finds on disk. Or it might be the exact same API used for the former site.
That's all.
The post Two Ways to Build a Site That Seem Super Different But Weirdly Aren’t That Different appeared first on CSS-Tricks.
from CSS-Tricks https://ift.tt/2rDK1vT
via IFTTT
No comments:
Post a Comment