techby@basilesamel

93 posts37,473 words

Technical posts about software development

Next

Oct 21, 2020

Nginx For JAMStack Apps

Pre-rendering your web pages following the JAMStack methodology is a sure way to decrease your time-to-first-byte metric, but dropping your NodeJS server when you can is even better. In any app, you need a webserver to send content back, but not all web servers are equal: a web server powered by Jav...

342 words

Oct 19, 2020

Image Processing and Pre-Rendering

Image processing is a huge performance pitfall in static website generators when it comes to total build time, so I don't automate this part where I can or do it at runtime when I have the opportunity. For example, I prefer handmaking the social cards of my blog articles to make them more unique an...

269 words

Oct 18, 2020

Start Coding, It's Not As Hard As You Think

Building an online business without knowing the basics of how the Internet works is a bit like cruising on a boat without knowing how to swim: it's doable, but you are at the mercy of everything and everyone. Learning how to code, even a little, is liberating. And it doesn't take a huge brain: there...

288 words

Oct 17, 2020

CI/CD with Github Actions

The way I deploy code to production is pretty archaic. I store my build in the Git repository (yikes, but at least I don't commit my node_modules folder), log in to my web server using a secure shell (ssh), git pull the latest changes from the master branch, restart the express server, and delete th...

396 words

Oct 12, 2020

Preact

It took longer than expected, but I managed to overcome all the technical locks I found using Preact as a frontend framework. Preact is like React, while weighing much less. It's an extremely important factor to take into account when you build websites, since a big bundle size reduces your page spe...

249 words

Oct 11, 2020

Another JAMStack Framework?

I love Gatsby and NextJs, but I don't like being tied down to their respective back-end infrastructure to handle advanced back-end use cases like incremental pre-rendering to reduce build time. The pricing is ridiculous when you compare it to a traditional cloud hosting plan. What full-stack web dev...

344 words

Oct 3, 2020

Code-Splitting with SSR Preact

It took me 3 days to figure out how to implement route-based code-splitting with server-side rendered Preact because of the lack of documentation, so I'm going to share with you in this article how I did it. Preact has the same API as React with only a fraction of the size (3kb), so it's interesting...

582 words

Oct 2, 2020

Bug Down

Programming is a constant roller-coaster oscillating between moments of glory and abysmal bugs. There are days where you spend hours trying to do something and still fail. It feels terrible, because there is no way to make up for lost time. But solving bugs is often a matter of persistence: you atta...

241 words

Sep 28, 2020

Lazy Hydration with React

The main performance pitfall with server-side rendered code occurs when it's time to hydrate the components with React. When you receive HTML from a server, React has no way to interact with it. Hydration is the phase where your server-side rendered React components become interactive. When you per...

239 words

Sep 23, 2020

Testing a New Hosting Provider

My current hosting provider isn't optimal since I moved away from PHP to code with NodeJS, so I'm testing a new hosting provider suggested to me by @phaidenbauer: Hetzner. I love the fast interface, the affordable prices, and the company values. I choose a Cloud server based in Finland that only cos...

259 words

Sep 22, 2020

Production Pre-Rendering

In an ideal world, a static website generator rebuilds its webpages independently, depending on content changes: if the webpack bundle is modified, you rebuild every webpage, but if it's a tiny sentence modification, you only want to rebuild the corresponding webpage. The reason is simple: the more ...

227 words

Sep 18, 2020

What's a Service Worker?

Web browsers evolved tremendously since the 80's and Tim Berners-Lee's first attempt at a software application designed to interact with web servers—now closer to full-blown virtual machines than mere applications. We have reached a point where web browsers can seamlessly provide both rich offline a...

310 words

Sep 17, 2020

Faster Internet

I've lived most of my life without a fast internet connection. It taught me a lot about patience, self-control, and the virtues of slowness. But now that most of my work happens online, I'm often constrained by my network: slow upload times, unusable websites, unstable video calls... it's not great....

395 words

Sep 16, 2020

The Maths of a Web Hosting Provider

I'm wondering whether it's possible to make a profitable web hosting business as a side project in 2020. A website cannot exist without web hosting, so you have to pay a certain amount of money to keep it alive. Static websites that do not change very fast (weekly) can use free hosting in the form o...

482 words

Sep 14, 2020

Energy Consumption of a Programming Language

Today I read a paper benchmarking different programming languages according to the amount of energy they consume, and it blew me away: Javascript consumes 4.5 times more energy than C PHP consumes 5 times more than Javascript Ruby and Python consume more than twice what PHP does Interpreted la...

246 words

Sep 12, 2020

Working on a New Personal Website

I'm using this post-launch weekend to take a break and work on a new personal website. I'm changing it to focus on tech, to offer tutorials, think pieces, and freelance services in the offline-first/green web development niche. Instead of posting everything I publish on Writelier, I'll curate and ed...

250 words

Sep 9, 2020

DIY Green Web Hosting

I'll be paying $320 in green web hosting between March 12 2020 and March 11 2021. $27 per month is not excessive to run multiple websites, but it's still shared hosting with only 2Gb of RAM, so I'll eventually need to upgrade. I'm perfectly satisfied with my current hosting provider, but I can still...

282 words

Sep 7, 2020

The Problem With Jamstack Frameworks

Jamstack frameworks as we know them aren't great for fast-changing web applications: the build time is too long (NextJS, Gatsby), or we can't use web components easily (Hugo). Even with NextJS's incremental static regeneration feature, the pre-rendering logic is far from optimal: I do not want my ap...

314 words

Aug 26, 2020

Database Migration With ETL

Operating a database migration is the most stressful thing you can do in the lifecycle of a web application. An application can break, but losing data is unacceptable: you need a process to prevent any data loss while minimizing service interruption. Whether you want to change your database system, ...

358 words

Aug 23, 2020

How To Speed Up 10X Your In-App Dashboard With Client Storage

If you built an app, your user probably accesses his data from a central dashboard. The traditional way to code a dashboard is to fetch the data from a web server, before serving the web page if you use server-side rendering, or by requesting a web service if you perform an asynchronous call from yo...

480 words

Aug 21, 2020

Why I Reached A One Second Page Speed

The speed of a web application matters more than you might think. A study published by Deloitte showed that increasing your loading speed by 100ms can improve your conversion rate and your number of page views by 10%, while decreasing your bounce rate up to 9%. If your page takes more than a second ...

375 words

Aug 19, 2020

On Auth

Authentication is how the app identifies a user, while authorization tells the app what the user can and cannot do. Both are essential to web applications to store data produced by a third-party. Authentication and authorization (auth for short) aren't simple things, but they are easy to implement—a...

573 words

Aug 17, 2020

MySQL: Fetching Many-To-Many Relationships

Fetching entries from Many-To-Many relationships is up to ten times faster and much more readable/easier to code using multiple SELECT statements than JOINs. I've been wondering for a few months how I could make complex queries more performant and readable, so today I decided to perform a little exp...

675 words

Aug 13, 2020

Back and Front

I love being a full-stack developer, and I don't see myself choosing between front-end or back-end anytime soon. They are two sides of the same coin. As Masanobu Fukuoka once wrote, an object seen in isolation from the whole is not the real thing: a specialist lacks awareness when it comes to graspi...

377 words

Next