UP | HOME

The state of the web

Returning from my Hiatus in web development

The last serious public website I've worked on was back in 2018, I switched over to HPC because it was more interesting and had greater potential for impact. Turned out to be a good call given AI and HPC have converged and allegedly $300B was spent in AI during the year of 2024.

What looks nice

New tech:

  • Declarative shadow DOM

Existing tech that improved:

  • WebGL (device GPUs are faster)
  • LLVM WebAssembly for C/C++

Declarative Shadow DOM

Declarative shadow DOM looks to be the final piece of the puzzle that enables better SEO for custom html element, see tangent below. This could be beneficial for bridging the gap of server side rendering and progressive enhancement. For instance a declarative shadow dom tempalte is made for some vustom element. It renders immediately, even if the browser doesn't support javascript or custom elements. For most browsers, the custom element Javscript code will start running and convert it into the thing. At this point it can be "progressively enhanced" so that future elements can be inserted into the page in their minimal form. It's difficult to describe, here's an example:

On initial load a custom element "my-article" is streamed in with declarative shadow dom defining the internal structure. This allows it to be rendered instantly.

<my-article>
  <template shadowrootmode="open">
    <slot></slot>
  </template>
  <h2>Article header</h2>
  <p>Article text</p>
</my-article>

Later on in the loading cycle, my-article will be initialized via Javascript whatever stuff is done. Let's say the page is now loaded and the user's reading the article. They're getting near the end and the site preloads the next article for user's convience. Now the only thing that needs to be added to the DOM is:

<my-article>
  <h2>Next Article</h2>
  <p>Next article text</p>
</my-article>

This later part is more about custom elements and not necessarily declarative shadow DOM, but highlights the reason for them.

So what happens when a web crawler hits the page that doesn't have Javascript enabled? Well it see my-article as an unknown element, however we still specified the internal elements which it should still see (correct me if I'm wrong here). To be safe I'd suggest using a Customized Built in Element.

WebGL

This isn't new per say. It's a Web API to load OpenGL shaders, built on OpenGL ES (embedded systems) spec. It used to have a lot of performance issues for mobile devices, however mobile devices continued to get more powerful and it should run fine on most modern phones.

LLVM WebAssembly

This also isn't new but has stuck around. There's still a lot of room for improvement but the core idea is sound. Let's stop using Javascript and instead use this "WebAssembly" low level virtual machine that's related to the Javascript runtime. This way we can compile any code we want to it and have it work. This looks nice because I do not like Javascript and would much rather just write something in C/C++. Looks to pair very well with WebGL. Now withd little extra code, one could write a 3D graphics application that compiles to both native code and a website. This could be cool for a game for example, I believe StormGate is doing something like this to enable a match viewer in the web browser. Cool idea: spectate a game by opening a link and have it render in real time.

Web Frameworks are like Fast Fashion

This is a rant.

There's a lot of websites and a lot of web developers out there. Many times I feel like they're constantly re-inventing the wheel. Maybe it's out of necessity, maybe it's for clout, or maybe it's so they can use their prefferred programming language. This isn't necessarily a bad thing, it spurs innovation.

Here's a few I've seen over the years:

  • Classic MVC style: main processing on server side with Qjuery in the DOM
  • AngularJS 1.X SPA: Move more processing to the "front-end" (DOM)
  • Web Components with server side rendering: Going the full loop. Back to the server.
  • PWA: Progressive Web Apps is an SPA that trys to be a native app.

My complaint is that it can be difficult to filter out the noise.

For example in my web dev hayday, I made a PWA for an E-commerce site following all of the guidelines set by Google, it even used their suggested libraries and shiny components. The site had that plastic Googley feel ("Material Design"), it was fast, it worked, and my client loved it. Ironically it did so poor in Google's own search engine that we reverted it back to the tried and true classic html with server side rendering. A few months later the original project (I'm not going to name and shame) was discontinued in classic Google style after the main developer got a promoation. Sadly I feel for the meme, wasted a lot of my client's money and my time, but learned a valuable lesson.

Author: Noah Pavuk

Exported: 2024-11-04 Mon 12:31

Emacs 27.2 (Org mode 9.4.4)

Validate