start

597: How Many VS Code Plugins, Poor Charlie’s Almanack, and Where to Start in 2024?

We're closing in on episode 600 and need your help to celebrate! Listen in to learn how to contribute to the episode. We're also talking GitHub desktop apps and code editors, how many VS Code plugins are needed, reading long form like Poor Charlie's Almanack, InVision shutting down, and answering our first Q of the year: how would you approach learning web development in 2024?




start

Start green, stay green

A recent CSE study found that many green-certified buildings were not eco-friendly after all. Deepa Sathiaram, executive director, En3 Sustainability Solutions, tells us what exactly goes wrong.




start

Startups join the party with craft mixers

How non-alcoholic mixers, handcrafted by small players, are edging out sugary soft drinks, sodas in cocktail glasses




start

Bengaluru startup develops new tech for battery recycling, begins production

Li-ion battery recycler Metastable Materials launches commercial ops




start

Delhi govt. to start drive against burning of waste in open today

Delhi, neighbouring States likely to experience ‘very poor’ quality air over next 10 days, have placed the depts. concerned on high alert: Gopal Rai




start

Start-up Compass: How Iconic Entrepreneurs got it Right

A relevant book for those about to embark on their entrepreneurial journey, or can serve as a useful resource for those who like to track the start-up ecosystem 




start

S. Korea woos startups in India with ‘grand challenge’

Wants them to look at Korea as a testing bed for their ventures




start

RIL arm to invest $16 million in US tech startup NetraDyne




start

Startup Grex gets new CEO after founders squabble




start

Ikea to start production unit in India




start

Muhurat trading: Sensex, Nifty advance to start Samvat 2081 on a high

Muhurat trading is a one-hour, symbolic trading session conducted by stock exchanges on the occasion of Diwali, marking the start of the new Samvat year.




start

Five-day special educator training programme to start from November 11

The initiative is being organised by Chennai Volunteers, a social initiative of the Giving Matters Foundation, a not-for-profit organisation, in collaboration with the Portobello Institute, Ireland




start

Deputy Chief Minister launches initiatives to support start-up ecosystem in T.N.

He also presents sanction letters for pre-incubation centres, which aim to support innovative business ideas in their initial stages




start

It All Starts with a Humble <textarea>

Andy Bell rings out a fresh call in support of the timeless concept of progressive enhancement. What does it mean to build a modern JavaScript-focussed web experience that still works well if part of the stack isn’t supported or fails? Andy shows us how that might be done.


Those that know me well know that I make a lot of side projects. I most definitely make too many, but there’s one really useful thing about making lots of side projects: it allows me to experiment in a low-risk setting.

Side projects also allow me to accidentally create a context where I can demonstrate a really affective, long-running methodology for building on the web: progressive enhancement. That context is a little Progressive Web App that I’m tinkering with called Jotter. It’s incredibly simple, but under the hood, there’s a really solid experience built on top of a minimum viable experience which after reading this article, you’ll hopefully apply this methodology to your own work.

What is a minimum viable experience?

The key to progressive enhancement is distilling the user experience to its lowest possible technical solution and then building on it to improve the user experience. In the context of Jotter, that is a humble <textarea> element. That humble <textarea> is our minimum viable experience.

Let me show you how it’s built up, progressively real quick. If you disable CSS and JavaScript, you get this:

This result is great because I know that regardless of what happens, the user can do what they needed to do when the loaded Jotter in their browser: take some notes. That’s our minimum viable experience, completed with a few lines of code that work in every single browser—even very old browsers. Don’t you just love good ol’ HTML?

Now it’s time to enhance that minimum viable experience, progressively. It’s a good idea to do that in smaller steps rather than just provide a 0% experience or a 100% experience, which is the approach that’s often favoured by JavaScript framework enthusiasts. I think that process is counter-intuitive to the web, though, so building up from a minimum viable experience is the optimal way to go, in my opinion.

Understanding how a minimum viable experience works can be a bit tough, admittedly, so I like to use a the following diagram to explain the process:

Let me break down this diagram for both folks who can and can’t see it. On the top row, there’s four stages of a broken-up car, starting with just a wheel, all the way up to a fully functioning car. The car enhances only in a way that it is still mostly useless until it gets to its final form when the person is finally happy.

On the second row, instead of building a car, we start with a skateboard which immediately does the job of getting the person from point A to point B. This enhances to a Micro Scooter and then to a Push Bike. Its final form is a fancy looking Motor Scooter. I choose that instead of a car deliberately because generally, when you progressively enhance a project, it turns out to be way simpler and lighter than a project that was built without progressive enhancement in mind.

Now that we know what a minimum viable experience is and how it works, let’s apply this methodology to Jotter!

Add some CSS

The first enhancement is CSS. Jotter has a very simple design, which is mostly a full height <textarea> with a little sidebar. A flexbox-based, auto-stacking layout, inspired by a layout called The Sidebar is used and we’re good to go.

Based on the diagram from earlier, we can comfortably say we’re in Skateboard territory now.

Add some JavaScript

We’ve got styles now, so let’s enhance the experience again. A user can currently load up the site and take notes. If the CSS loads, it’ll be a more pleasant experience, but if they refresh their browser, they’re going to lose all of their work.

We can fix that by adding some local storage into the mix.

The functionality flow is pretty straightforward. As a user inputs content, the JavaScript listens to an input event and pushes the content of the <textarea> into localStorage. If we then set that localStorage data to populate the <textarea> on load, that user’s experience is suddenly enhanced because they can’t lose their work by accidentally refreshing.

The JavaScript is incredibly light, too:

const textArea = document.querySelector('textarea');
const storageKey = 'text';

const init = () => {

  textArea.value = localStorage.getItem(storageKey);

  textArea.addEventListener('input', () => {
    localStorage.setItem(storageKey, textArea.value);
  });
}

init();

In around 13 lines of code (which you can see a working demo here), we’ve been able to enhance the user’s experience considerably, and if we think back to our diagram from earlier, we are very much in Micro Scooter territory now.

Making it a PWA

We’re in really good shape now, so let’s turn Jotter into a Motor Scooter and make this thing work offline as an installable Progressive Web App (PWA).

Making a PWA is really achievable and Google have even produced a handy checklist to help you get going. You can also get guidance from a Lighthouse audit.

For this little app, all we need is a manifest and a Service Worker to cache assets and serve them offline for us if needed.

The Service Worker is actually pretty slim, so here it is in its entirety:

const VERSION = '0.1.3';
const CACHE_KEYS = {
  MAIN: `main-${VERSION}`
};

// URLS that we want to be cached when the worker is installed
const PRE_CACHE_URLS = ['/', '/css/global.css', '/js/app.js', '/js/components/content.js'];

/**
 * Takes an array of strings and puts them in a named cache store
 *
 * @param {String} cacheName
 * @param {Array} items=[]
 */
const addItemsToCache = function(cacheName, items = []) {
  caches.open(cacheName).then(cache => cache.addAll(items));
};

self.addEventListener('install', evt => {
  self.skipWaiting();

  addItemsToCache(CACHE_KEYS.MAIN, PRE_CACHE_URLS);
});

self.addEventListener('activate', evt => {
  // Look for any old caches that don't match our set and clear them out
  evt.waitUntil(
    caches
      .keys()
      .then(cacheNames => {
        return cacheNames.filter(item => !Object.values(CACHE_KEYS).includes(item));
      })
      .then(itemsToDelete => {
        return Promise.all(
          itemsToDelete.map(item => {
            return caches.delete(item);
          })
        );
      })
      .then(() => self.clients.claim())
  );
});

self.addEventListener('fetch', evt => {
  evt.respondWith(
    caches.match(evt.request).then(cachedResponse => {
      // Item found in cache so return
      if (cachedResponse) {
        return cachedResponse;
      }

      // Nothing found so load up the request from the network
      return caches.open(CACHE_KEYS.MAIN).then(cache => {
        return fetch(evt.request)
          .then(response => {
            // Put the new response in cache and return it
            return cache.put(evt.request, response.clone()).then(() => {
              return response;
            });
          })
          .catch(ex => {
            return;
          });
      });
    })
  );
});

What the Service Worker does here is pre-cache our core assets that we define in PRE_CACHE_URLS. Then, for each fetch event which is called per request, it’ll try to fulfil the request from cache first. If it can’t do that, it’ll load the remote request for us. With this setup, we achieve two things:

  1. We get offline support because we stick our critical assets in cache immediately so they will be accessible offline
  2. Once those critical assets and any other requested assets are cached, the app will run faster by default

Importantly now, because we have a manifest, some shortcut icons and a Service Worker that gives us offline support, we have a fully installable PWA!

Wrapping up

I hope with this simplified example you can see how approaching web design and development with a progressive enhancement approach, everyone gets an acceptable experience instead of those who are lucky enough to get every aspect of the page at the right time.

Jotter is very much live and in the process of being enhanced further, which you can see on its little in-app roadmap, so go ahead and play around with it.

Before you know it, it’ll be a car itself, but remember: it’ll always start as a humble little <textarea>.


About the author

Andy Bell is an independent designer and front-end developer who’s trying to make everyone’s experience on the web better with a focus on progressive enhancement and accessibility.

More articles by Andy




start

This Chennai-based startup customises your sneakers so you can put your personality on them

Pastels, bling, or bold colours, whatever be your taste, K-kix, a sneaker customisation platform from Chennai can do it for you



  • Life &amp; Style

start

From techno-inspired rave bags to pants that depict neurons, this Chennai-based gender neutral fashion label’s creations are conversation starters

Brimming with cut outs, panels, thread piping and embroidery, Biskit’s new collection explores the human mind



  • Life &amp; Style

start

Jumpstart: Sweating it out with Yoga

Yoga is often dissed by the younger generation as light, easy, slow exercise. BHUMIKA K. begs to differ after going through a ‘happy yoga’ class




start

How to start running




start

Jumpstart: Drumming up a fitness boost

Who would have thought that drumming would be a fun fitness workout? ALLAN MOSES RODRICKS drops the beat on the rhythmic regimen




start

A kickstart to self defence

There are ways to safeguard your physical and mental well being, say martial arts trainer Kyoshi K.S. Sekar and Krav Maga master S. Sreeram who will soon teach in Coimbatore




start

Field-level police personnel in DK, Udupi start using bodycams

“In addition to brining in transparency, the bodycams will make police personnel more conscious and improve their conduct with people,” Mangaluru Police Commissioner Anupam Agrawal said




start

IIITH's social incubator hosts roundtable on climate-tech startups




start

IndiaAI, Meta launch AI center in IIT Jodhpur; will promote student start-ups




start

Proptech start-up HouseEazy raises $7 mn in funding from Chiratae Ventures, others

Funds will be utilised to fuel company’s growth across NCR




start

Hyperverge: An early start and growing

The startup company aims at solving the problem of photo organisation for smart-phone users.




start

Headstart to success

You don’t have to wait till Class XI to start preparing for IIT-JEE. Here’s why.




start

Focus on Sanju, Abhishek as India eye winning start

Captaon Suryakumar Yadav, all-rounders Hardik Pandya and Axar Patel, the only member from the Test side, will be hoping for a strong outing so that India can apply some balm over the wounds from their recent home series defeat against New Zealand.




start

Erik ten Hag fired as Manchester United fire manager after troubled start to season

Erik Ten Hag, who was hired in 2022, paid the price for leading United to just three wins in nine league games in the opening months of the campaign. Ruud van Nistelrooy was named interim coach.




start

Man United makes its worst league start in almost 40 years after 1-1 draw with Chelsea

Moises Caicedo’s stunning long-range volley has secured a 1-1 draw for Chelsea against Manchester United in the Premier League




start

Barcelona, Inter and upstart Brest win again in Champions League; bizarre penalty dooms Aston Villa

Barcelona and Inter Milan lead Champions League standings, with Brest as a surprising newcomer in contention




start

Ragi, paddy procurement under MSP to start soon in Mysuru

MSP for ragi has been fixed at ₹4,290 a quintal while for paddy, the MSP is ₹2,300 a quintal; farmers must register on the FRUITS portal to use the facility




start

Once Samson starts striking, it’s hard to stop him: South Africa captain Markram on whirlwind century

“Plans to negate him and better plans will help us going forward,” said Aiden Markram




start

Bvlgari starts digital boutique in India in tie up with Tata CLiQ Luxury

The digital boutique will also house Bvlgari time-pieces including the Serpenti, the Octo Finissimo collection, as well as the Octo Roma.




start

Expo at Huddle Global 2024 to showcase Deep Tech, R&D start-ups

CM to open conclave on Nov. 28. Event a platform for start-ups to present their advanced solutions and engage in interactive demonstrations before major stakeholders from across the world




start

Starting trouble

The defeat to Rising Pune Supergiants was Mumbai’s fourth successive loss in opening matches, and fifth overall




start

Delayed Asian Games rescheduled to start in September 2023

The Olympic Council of Asia on Tuesday confirmed the delayed games would be held from September 23 to October 8




start

Centre re-starts retail sale of pulses as prices rise ahead of festivals

Direct interventions through retail sale of basic food items such as rice, atta, dal and onion have helped maintain a stable price regime, Union Consumer Affairs and Food Minister Pralhad Joshi said




start

NEET-UG 2024 counselling to start in July

SC hearing adjourned to July 18; government assures action against malpractices




start

ISB launches 20-month PGP for Young Leaders starting 2025

This residential MBA-equivalent program targets high-potential candidates with up to two years of work experience. 




start

Start, action, campus

What is drawing youngsters to cinema these days?




start

Govt. has started acquisition of private land for flood mitigation projects in the city: Udhayanidhi

Civic agencies have been directed to prepare for rain over the next four days. A total of 1,194 pumps and 524 jet-rodding and 158 super-sucker machines have been readied for use in the city, he says




start

Electric truck initiative off to a good start

Incentives under PM E-DRIVE must be backed by tighter fuel consumption rules, charging infra and demand creation




start

Rain may have helped form the first cells, kick-starting life as we know it

How did the earliest, simplest cells hold it all together before elaborate membrane structures evolved?




start

Chinese startup to sell tickets for 2027 space tourism flights

Deep Blue Aerospace will put the tickets up for sale on October 24 for a suborbital flight




start

Cutting-edge skills for the startup space

"We are keen on seeing as many spin-out businesses as we can from the programme."




start

Kick-start a career in sports

Purdue University offers a vibrant athletic training programme.




start

Get started!

The Startup Centre does just that — help small teams set up web-based businesses



  • Money &amp; Careers

start

Get started early

There are benefits if you start working early. Warren Buffet and Bill Gates are good examples of this.



  • Money &amp; Careers

start

Indian Space Startup Pixxel Bags NASA Contract To Support Earth Science Research

The satellites can help detect, monitor, and predict critical global phenomena across agriculture, oil and gas, mining, environment, and other sectors in up to 50 times richer detail. 




start

ISRO to start online training programme for PG and and final-year UG students

The programme will cover various domains of Space Science, including Astronomy and Astrophysics, Heliophysics and Sun-Earth interaction, Instrumentation, and Aeronomy.