Blog header
Thoughts On The Modern Web

How To Hydrate A Server-Side Rendered Web Component

An in-depth guide to lazy loading Web Components

Header for posting How To Hydrate A Server-Side Rendered Web Component

Declarative Shadow DOM enables us to attach a Shadow root to a Custom Element and fully render it without any JavaScript. This is a huge step for web components since they can now be rendered on the server. But there is a slight problem though.

Read more >
calendar icon

May 10, 2023

How To Server-Side Render A Web Component

Blazing fast lazy-loaded Web Components

Header for posting How To Server-Side Render A Web Component

Server-side rendering means the server sends a complete HTML document to the browser which then renders it. This is in contrast to client-side rendering where a partial HTML page is sent to the browser and then JavaScript renders the rest in the browser.

Read more >
calendar icon

Apr 27, 2023

How Web Apps Became Decoys To Get You To Install Native Apps

The web is now an irrelevant alternative and we must do better

Header for posting How Web Apps Became Decoys To Get You To Install Native Apps

You know that popcorn price list at the cinema where the large bucket is only slightly more expensive than the medium size one?

That medium size is only a decoy to get you to buy the large one.

If you can get a large bucket for only 50 cents extra, why would you buy the medium one?

Read more >
calendar icon

Nov 21, 2022

The Hidden Power of Custom States For Web Components

A crucial step in the evolution of Custom Elements

Header for posting The Hidden Power of Custom States For Web Components

In my previous articles “Web Components Can Now Be Native Form Elements” and “Native Form Validation Of Web Components”, I wrote about the ElementInternals property that enables Custom Elements to be associated with a form.

This interface also enables developers to associate custom states with Custom Elements and style them based on these states.

Read more >
calendar icon

Nov 15, 2022

Native Form Validation Of Web Components

A thorough guide to easy, native form validation

Header for posting Native Form Validation Of Web Components

In my previous article “Web Components Can Now Be Native Form Elements” I explained how the ElementInternals object can be used to make Web Components participate in forms just like any other native form element.

In this article I will explain how you can easily validate these custom form controls using nothing but the native platform

Read more >
calendar icon

Sep 13, 2022

Web Components Can Now Be Native Form Elements

Here’s the complete guide to customised form controls

Header for posting Web Components Can Now Be Native Form Elements

One area in which developers have always wanted to customize elements is forms.

Historically, it has often been hard to style form controls to give them the look and feel you want.

The styling options are often limited and to this day, form controls like date and color pickers are still inconsistent across browsers.

Read more >
calendar icon

Aug 9, 2022

Everything You Always Wanted To Know About Web Components (But Were Afraid To Ask)

Here’s what you need to know

Header for posting Everything You Always Wanted To Know About Web Components (But Were Afraid To Ask)

How well do you know Web Components? What would you like to know about Web Components?

Here are the answers to the most common questions I get asked frequently.

Read more >
calendar icon

Jul 21, 2022

Hidden gems inside your browser, hiding in plain sight.

Mind-blowing browser features that are still underused.

Header for posting Hidden gems inside your browser, hiding in plain sight.

Your browser can do some pretty awesome things that you probably didn’t know about.

I work with browsers every day and I’m still amazed at some of the stuff I find. Sometimes, I discover features that I thought were only possible in native apps and it seems I’m not the only one, because many of these are hardly even used in websites!

Read more >
calendar icon

Feb 1, 2022

Smart Styling Of Web Components

How to leverage state-based styling the smart way

Header for posting Smart Styling Of Web Components

One of the killer features of Web Components is true encapsulation of styling through Shadow DOM.

This means that the internal CSS of a Web Component can be completely isolated from the surrounding document without the need for a particular naming convention.

Read more >
calendar icon

Nov 16, 2020

Your Single-Page App Is Now A Polyfill

You simply can’t beat the platform

Header for posting Your Single-Page App Is Now A Polyfill

Why do we build single-page apps? Two main reasons really.

We want our web apps to feel “instant”, without any ugly blank screens in between pages that remind us our app is not really like an app.

Blank screens make for a bad user-experience. Users don’t want to wait for content to arrive from a server when they click a link or a button. They expect websites to be fast like native apps.

Read more >
calendar icon

Oct 6, 2020

The Failed Criticism of Web Components

Why Lea Verou’s criticism of Web Components is misdirected

Header for posting The Failed Criticism of Web Components

Here’s my response to Lea Verou’s article “The failed promise of Web Components” that was published last Thursday.

I was pointed to the article by someone on Twitter and first thought I was pointed to the article “The broken promise of Web Components” that was published in 2017, but that was not the case.

Read more >
calendar icon

Sep 27, 2020

How To Extend A Native HTML Element

When standard HTML is not enough

Header for posting How To Extend A Native HTML Element

Ever since the days of XML we have tried to extend HTML with our own tags.

The standard library of HTML tags is fairly limited and intentionally consists of low-level building blocks, meant to be composed by developers into more high-level functionality.

Now that all modern browsers support Web Components (or more specifically Custom Elements) you can create your very own HTML elements that you can use anywhere by just loading a script and adding the tag to the document.

Read more >
calendar icon

Aug 31, 2020

How To Enable Experimental Features In Your Web App

No transpiling needed

Header for posting How To Enable Experimental Features In Your Web App

Web apps are nowadays more capable than ever and can easily compete with native apps when it comes to features.

JavaScript is more powerful than ever and your browser is now equipped with stuff like geolocation, media capture and access to the sensors of your mobile device to name a few.

These are certainly exciting times.

Read more >
calendar icon

Jun 1, 2020

It’s Time To Kill The Password

How to get ready for a passwordless future with Web Authentication

Header for posting It’s Time To Kill The Password

Imagine you had some very valuable jewellery stashed away in a safe somewhere.

The only way to open this safe is to give the code to another person who will then open it for you. You write the code on a piece of paper, put it in an envelope, close it and then give it to this person.

Read more >
calendar icon

May 24, 2020

The Case for Mobile Web Apps

You might not need a native app or even a PWA

Header for posting The Case for Mobile Web Apps

Apple once again received a lot of criticism last month after announcing that the latest Safari release will now erase all locally stored data by a website after a user hasn’t interacted with that website for seven days.

Although Apple later clarified that this doesn’t apply to apps installed on the home screen (PWAs), many people were still outraged and claimed that Apple is trying to kill PWAs.

Read more >
calendar icon

Apr 6, 2020

Progressive Web Apps Will Replace Your Native App

There’s no way back, but we’re not there yet.

Header for posting Progressive Web Apps Will Replace Your Native App

When Steve Jobs introduced the very first iPhone in 2007, he spoke of how developers would be able to create amazing apps for the iPhone, using only web technologies. There was no App Store yet at that time and no notion of native apps.

What Jobs envisioned is the concept we now know as Progressive Web Apps, basically websites that have an app-like behavior and are able to work offline.

Read more >
calendar icon

Mar 10, 2020

How To Make Your Website Work Offline part 2

Your dynamic content can be made available offline as well

Header for posting How To Make Your Website Work Offline part 2

In my previous article I showed you how you can easily make your static website work offline by using a service worker.

But most websites today don’t only exist of static content, but dynamic content as well. This content can come from a REST API for example and this type of content won’t normally be available when a client is offline.

Read more >
calendar icon

Mar 2, 2020

How To Make Your Website Work Offline

Better performance and user experience in one easy step

Header for posting How To Make Your Website Work Offline

This is part 1 of a two-part series, part 2

Did you ever open a native app on your phone to be greeted with the picture of a dinosaur, telling you that you need to connect to the internet before you can even use the app?

No. Most native apps give you a much better user experience and show you at least something until you’re connected again.

Read more >
calendar icon

Feb 9, 2020

There’s No Need To Hate Web Components

And you don’t need to drop your framework either

Header for posting There’s No Need To Hate Web Components

Four years ago, I landed a freelance gig at an international Dutch bank. Originally I was hired to help with migrating applications from AngularJS to Angular 2, but things turned out differently all of a sudden.

One day, I bumped into one of the managers who urged me to “have a look at Polymer”, since a team in Australia had created some nice stuff with it. Polymer was now the way to go forward and literally within a few weeks, we were in the middle of migrating to Polymer.

Read more >
calendar icon

Jan 21, 2020

We’re Killing the Mobile Web

But we may be able to save it as well

Header for posting We’re Killing the Mobile Web

Has this ever happened to you?

You’re browsing the web on your mobile phone or tablet and a banner appears on the top of the screen, urging you to install the site’s native app. This is the first time you ever visit this website, and so you decide not to install the app.

But when you visit the website a few more times, the banner keeps appearing, and after a while, you decide to give their native app a try.

Read more >
calendar icon

Jan 7, 2020

JavaScript doesn’t need to be replaced

Other languages will face the same issues.

Header for posting JavaScript doesn’t need to be replaced

Every now and then someone will argue that JavaScript needs to be replaced by some other language. The reasons for this are always that JavaScript has too many quirks that should have been fixed a long time ago.

But since these haven’t been fixed it apparently means that JavaScript is a crappy language that’s simply cannot be fixed. And so it needs to be replaced, preferably by the complainer’s favorite language.

Read more >
calendar icon

Nov 24, 2019

How To Run a Proxy Server Inside Your Browser

You don’t even need a local back end — just a service worker

Header for posting How To Run a Proxy Server Inside Your Browser

While I was debugging a video-chat application I was working on recently, I had to run the full chain locally. This meant running the front end locally — as well as the two REST APIs it communicates with, which are written in Java.

Now, I’m not a Java developer, so getting both APIs running on my development machine was a bit of a challenge. On top of that, I was behind a corporate proxy, and this client requires me to work on a Windows machine they provide.

Read more >
calendar icon

Nov 17, 2019

The Lost Art of Vanilla JavaScript

When programming became gluing libraries together

Header for posting The Lost Art of Vanilla JavaScript

A couple of months ago, I did a talk on Web Components for a tech company where most attendees had no prior experience with them. It was a very fun and well-received talk that ended with a round of questions from the audience that lasted over half an hour.

Near the end, someone asked me if this meant that we were going back to the days of what he called “jQuery-like spaghetti code,” due to the raw DOM manipulation code I had shown. I could see some others nod in agreement, and this reaction really got me thinking.

Read more >
calendar icon

Oct 27, 2019

Why Coding Your Own Makes You a Better Developer

To truly understand the wheel, you need to reinvent it

Header for posting Why Coding Your Own Makes You a Better Developer

The other day I interviewed for a senior developer position with a JavaScript developer. My colleague, who was also in the interview, asked the interviewee to write a function that would perform an HTTP call and retry it a number of times if it failed.

Since he was writing it on a whiteboard, pseudo-code would have been enough. If he had just demonstrated a good understanding of the matter we would have been happy. But unfortunately, he wasn’t able to come up with a good solution.

Read more >
calendar icon

Oct 6, 2019

What You Need to Know About Asynchronous Programming in JavaScript

You can’t afford to get this wrong.

Header for posting What You Need to Know About Asynchronous Programming in JavaScript

Throughout my career I’ve been in a lot of job interviews, both as an interviewer and as a candidate. I’ve seen my share of candidates fall apart when asked to code asynchronous code using Promises and async/await.

Asynchronous programming is the bread and butter of JavaScript, yet so many developers fail to truly understand it for some reason.

Read more >
calendar icon

Sep 22, 2019

Using the DOM like a Pro

How to stop fearing the DOM, use it to its full potential and actually start loving it

Header for posting Using the DOM like a Pro

When I first started working as a professional web developer back in 2008 I knew some HTML, CSS and PHP. At the same time I was also learning this thing called JavaScript because it allowed me to show and hide elements and do cool things like dropdown menus.

At the time I was working for a small company that mainly created CMS systems for clients and we needed a multiple file uploader. Something that was not possible at that time with native JavaScript.

Read more >
calendar icon

Sep 1, 2019

Data binding for Web Components in just a few lines of code

It’s not rocket science and Virtual DOM is usually overkill anyway.

Header for posting Data binding for Web Components in just a few lines of code

Earlier this year I wrote an article in which I claimed that Web Components will eventually replace frontend frameworks.

It generated quite some response, more than I could have hoped for and it gave me some interesting opportunities. Lots of people agreed with me, others were more critical and a few people thought I was completely out of my mind and should be banned from writing code forever. In general, good points were being made on both sides.

Read more >
calendar icon

Aug 18, 2019

Web Components will replace your frontend framework

The native web platform has caught up with frontend frameworks and will slowly render them obsolete.

Header for posting Web Components will replace your frontend framework

Remember when document.querySelector first got wide browser support and started to end jQuery's ubiquity? It finally gave us a way to do natively what jQuery had been providing for years: easy selection of DOM elements. I believe the same is about to happen to frontend frameworks like Angular and React.

These frameworks have enabled us to do what we always wanted but never were able to: creating reusable autonomous frontend components, but at the cost of added complexity, proprietary syntax and increased payloads.

Read more >