NBA’s restart plan amidst coronavirus includes daily testing of players, limited locations: Reports
NBA Commissioner Adam Silver explained the plan in a conference call open to all NBA players.
NBA Commissioner Adam Silver explained the plan in a conference call open to all NBA players.
WordPress is super versatile. You know that. I know that. But sometimes this can be an overwhelming prospect. How on earth will you get your site up and running? What platform will you use? Zurb Foundation and Bootstrap are two …
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.
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!
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.
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.
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:
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!
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>
.
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.
This might be the second biggest evacuation exercise undertaken since 1990, NDMA officials.
Consumers pre-booking on Samsung Shop will get 15 per cent cashback when paying with HDFC cards
Under its 'Stay Home, Stay Safe' programme, Sony is offering discounts and special price offer on its products
02:21 - Tyler McGinnis Introduction
03:23 - Getting Started at DevMountain
04:38 - DevMountain Conception
05:37 - How Do I Learn How to Code?
08:03 - Resources => Consume ALL THE Information
11:16 - Two Camps: Art (Creators) and Technicians <= Does DevMountain Cater to One or the Other?
13:08 - Repetition as a Way to Learn
15:23 - Letting People Struggle vs Helping Them
17:14 - Training/Finding Instructors / Teaching Teachers to be Better Teachers
21:08 - Why Is JavaScript a Good Language to Learn?
24:11 - DevMountain Mentors
26:30 - Student Success Stories
28:56 - Bootcamp Learning Environments
34:11 - Oldest and Youngest Students (Success Stories Cont’d)
37:18 - Bootcamp Alumni (Employment Rates and Statistics)
Picks
Costco Kirkland Brand Peanut Butter Cups (Dave)
[Confreaks] Tyler McGinnis: What I’ve Learned about Learning from Teaching People to Code (Dave)
[YouTube] Katya Eames: How to Teach Angular to your Kids (Dave)
[YouTube] Misko Hevery and Rado Kirov: ng-conf 2015 Keynote 2 (Dave)
Mandy’s Fiancé (AJ)
[YouTube] Katya Eames: How to Teach Angular to your Kids (Joe)
ng-conf Kids (Joe)
Salt (Joe)
[YouTube] Dave Smith: Angular + React = Speed (Tyler)
[YouTube] Igor Minor: (Super)Power Management (Tyler)
React.js Newsletter (Tyler)
Dave Smith’s addendum to his talk (Joe)
Mani Vaya joins Charles Max Wood to talk about how developers can add the enterepreneur hat to the others they wear by starting a side gig. They discuss various ideas around entrepreneurship, the books they got them from, and how they've applied them in their own businesses.
"The MaxCoders Guide to Finding Your Dream Developer Job" by Charles Max Wood is now available on Amazon. Get Your Copy Today!
Mani Vaya:
Charles Max Wood:
Follow JavaScript Jabber on Twitter > @JSJabbber
Agritech start-up Brainwired, which provides livestock health monitoring and tracking solution has raised undisclosed funding from Mumbai Angels. The
Interview with Marc S. Sabatine, MD, MPH, author of Efficacy and Safety of Further Lowering of Low-Density Lipoprotein Cholesterol in Patients Starting With Very Low Levels: A Meta-analysis
Leganes coach Javier Aguirre had said that the Spanish football season will re-start on June 20.
The Premier League's 'Project Restart' envisages a return to play in June, once given the green light from government, with the remaining 92 matches held behind closed doors at neutral venues.
Serie A teams have been allowed to start practice this week but only with players training individually and respecting social distancing. Full team practice is due to begin on May 18, but only if the medical protocol is approved.
Spurred by activism, educators are reworking curricula to train future generations to adapt to our changing climate
The MIT chemical engineering head is charting a course into the start-up world with LayerBio
The Library of Congress Preservation Directorate is excited to present a Topics in Preservation Series (TOPS) for Preservation Week 2020! From April 27-May 1, we are hosting webinars every day at 11am (EST). The five, hour-long webinars will feature preservation related projects conducted at the Library of Congress. Register now for any, or all, of the following webinars at http://LOCPreservation.eventbrite.com or at the links below. For more information and resources related to preservation at the Library of Congress, visit https://www.loc.gov/preservation/
Keeping it Cool – Designing the Library’s New Gutenberg Bible Display Case
Monday, April 27th, 11am – 12pm Register here
The Library of Congress’ Gutenberg Bible is on permanent display in the Thomas Jefferson Building. Even though its three volumes are displayed on a rotating basis, the concerns about the adverse effects of long-term display required the Library’s’ conservation staff to create a purpose designed display case that would mitigate these adverse effects. The speakers will talk about the design process, present various features of the new case, and share with the audience some lessons learned now that the case is fully functioning for a little over a year.
Presented by Elmer Eusman, Chief, Conservation Division and Nancy Lev-Alexander, Head, Collection Stabilization Section
Acquiring and Developing an Offsite High Density Collections Storage Facility
Tuesday, April 28th, 11am – 12pm Register here
In addition to operating state-of-the art preservation quality storage facilities at Ft. Meade, the Library operates a rental property which meets its needs for interim storage. This webinar discusses the Library’s experience in acquiring and developing this facility. Cabin Branch (located in Landover, MD) shows a way to control costs without compromising on collections care. The webinar will explain how the Library of Congress designed an interim storage warehouse with collections safety foremost in mind, while keeping cost under control by working with the developer to focus on the features most critical to safeguarding our collections.
Presented by Steve Herman, Chief, Collections Management Division; Rohn Roache, Assistant Chief, Collections Management Division; Nancy Lev-Alexander, Head, Collection Stabilization Section
Assessing the Condition of the United States National Collection
Wednesday, April 29th, 11am – 12pm Register here
A national research initiative funded by the Mellon Foundation “Assessing the Physical Condition of the National Collection” is undertaking the task to objectively assess the condition of books held in collecting institutions of the United States by performing an in-depth scientific analysis on a representative sample.
The research focuses on analyzing the same 500 volumes from five different research libraries in five different climatic zones through the time period 1840-1940. Research to date has shown some extremely interesting trends. This presentation will focus on the analytical techniques used in the program and show what this means to the preservation of print collections throughout the United States.
Presented by Fenella France, Chief, Preservation Research and Testing Division
Environment, Housing & Building Materials Testing to Protect our Collections
Thursday, April 30th, 11am – 12pm Register here
Challenges to preserving the national collection come from both inherent risks in the collections themselves and from materials in the immediate environment. The Library’s quality assurance program is focused on analyzing all materials that come into contact with collections or are part of the surrounding environment. The quality assurance (QA) program involves testing of materials used for housing, storage, and in conservation treatments, as well as evaluation, definition, and dissemination of standards for the use of these materials.
This presentation will give specific examples of QA testing, new developments in quantification and identification of volatile organic compounds, fast and accurate test methodologies, examples of collection inherent material challenges, and assessment of off-gassing from potential building and housing materials to determine safety for special collections.
Presented by Dr. Eric Monroe, Supervisory Physical Scientist
Would You Like to Save Your Game?
Friday, May 1st, 11am – 12pm Register here
Libraries, archives and museums are facing an ever increasing amount of interactive media in their collections, including software applications, time based artworks and video games. These materials provide unique challenges in regards to acquisition, description and preservation, and many institutions are working to develop new approaches to ensuring the long term preservation of and access to born digital cultural artifacts. The Library’s National Audio-Visual Conservation Center (NAVCC) holds over 5,000 videogames amassed through copyright deposit and private donation. This collection contains not only a wide array of formats from 5.25” floppy disks to modern console cartridges, but also packaging, documentation, and adjacent materials such as magazines. The Preservation Reformatting Division and NAVCC work together to describe, reformat, and preserve these complex digital objects and preserve this important part of culture. This webinar will highlight different aspects of the preservation workflow.
Presented by Amanda May, Digital Conservation Specialist; David Gibson, Processing Technician; Laura Davis, Project Specialist
Click here for more information about the webinars.
The industry would like to commence operations at the earliest to avoid cancellation of pending orders
It's already May, and parts of the country hit 40 degrees Celsius a few days ago, making situations worse for people living in cramped quarters to stay indoors
This comes as seed investments in India during the January-March quarter, which was hit by the lowest level in five quarters
The retail inflation that for several months remained in the comfort zone of the central bank has started inching up and crossed the 7 per cent mark during December 2019
The size of the UP Annual Budget 2020-21 is expected to breach the historic mark of Rs 5 trillion
"All these expenditures are unlikely to be imparting any fresh growth stimulus to the Indian economy," he argued