Superwebapps: Rethinking Desktop Applications With Progressive Web Apps

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2025
November 17 - 20, 2025
New York, US & Online
See JS stars in the US biggest planetarium
Learn More
In partnership with Focus Reactive
Upcoming event
JSNation US 2025
JSNation US 2025
November 17 - 20, 2025. New York, US & Online
Learn more
Bookmark
Rate this content

Progressive web apps describe a whole new set of browser features that enable completely new ways of interacting with web applications.

While originally intended as an alternative to mobile apps, we are seeing more and more desktop apps that rely on the web platform. Photoshop, Visual Studio Code, Squoosh, Clipchamp and the whole Google Office Suite are just a few examples of a growing number of completely web-based desktop applications - Superwebapps!.

In this talk, we will focus on some of the new and exciting browser capabilities that allow us to create powerful React applications that make our daily lives easier. Of course, including tangible examples and an outlook on the browser roadmap.

This talk has been presented at React Summit 2024, check out the latest edition of this React Conference.

FAQ

MDEdit is a tool that converts Markdown into HTML, providing a what-you-get editor to write HTML that can be converted back to Markdown. It functions as a Markdown editor app or website.

MDEdit can be considered both a website and an app. It aims to offer functionalities of both, including reading and writing files, and working offline, making it a super web application.

Progressive Web Apps (PWAs) are web applications that progressively gain more app-like features, such as offline functionality and push notifications, making them comparable to native apps. They are designed to work universally across different operating systems and screen resolutions.

A Web App Manifest is a JSON file that contains metadata about a web application, such as its title, description, colors, and icons. It allows the browser to recognize and offer the app for installation.

A Service Worker is a JavaScript file that runs separately from the main browser thread. It can intercept network requests, cache resources, and enable offline functionality, even when the browser is closed.

MDEdit uses Service Workers to cache resources and handle network requests, allowing the app to function even when the internet connection is lost. This ensures reliability and faster load times.

Web applications can use session storage, local storage, IndexedDB, and the Origin Private File System API to store data. Session and local storage are limited in size, while IndexedDB and the Origin Private File System API offer more extensive storage options.

The File System Access API allows web applications to read and write files directly on a user's device. It enables more advanced file handling capabilities, such as opening and saving files directly from the app.

Project Fugu is a collaborative effort by Google, Microsoft, and Intel to bridge the gap between native apps and web applications. It aims to enhance web capabilities through new APIs, making web apps more powerful and versatile.

The Local Font Access API allows web applications to access and use fonts installed on a user's device. It enhances customization options for applications like MDEdit, which can use these fonts for better text rendering.

Nico Martin
Nico Martin
22 min
18 Jun, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
MDEdit is a tool that converts Markdown into HTML and provides a what-you-get editor. Progressive web apps offer a comparable user experience on both desktop and mobile devices. The Service Worker allows web apps to remain functional even without an internet connection. The Persistent Storage and File Handling APIs enable web apps to store data and access files on the client's device. Project Fugu provides new APIs, including the Font Access API, to bridge the gap between native apps and web applications.

1. Introduction to MDEdit and Progressive Web Apps

Short description:

MDEdit is a tool that converts Markdown into HTML and provides a what-you-get editor. It wants to read files, write files, and work offline. It is a Super Web Application, bridging the gap between the browser and native applications. Progressive web apps offer a comparable user experience on both desktop and mobile devices. They should be fast, integrated, reliable, and engaging. The Web App Manifest and the Service Worker are core concepts introduced by browsers to solve these problems.

Hi, everyone. My name is Nico. I am a front-end developer from Switzerland, and here with me is MDEdit. MDEdit is a tool that converts Markdown into HTML, and it then provides a what-you-get editor that lets you, or that helps you, write HTML that will then be converted back to Markdown. In other words, it's a Markdown editor app or Markdown editor website.

I mean, MDEdit is a little bit in an identity crisis, because what is it? Is it a website? Is it an app? Is it a tool that uses HTML, CSS, and JavaScript? But it wants to do so much more. It wants to read files. It wants to write files. It wants to work offline. So it's more of a web app with super powers.

Speaking of super powers, do we have any classic DC comic fans here? Do we? Well, so maybe we are able to help my little friend. Because what is it? Is it a website? Is it an app? Is it a bird? To put it plain, it is a Super Web Application, or at least that's what they would have been called if I had been given the chance to name those things. Unfortunately, or also luckily for everyone else, Alex Russell was way before me, and he was back then working at Google, and he was thinking a lot about how to bridge the gap between the browser and native applications. And he was thinking about websites that you could grant more and more permissions. They would progressively become apps. So he coined the term progressive web apps. And maybe you have already heard a lot about progressive web apps in terms of mobile applications.

However, the web is unique in the sense that it's not tailored to one specific operating system or screen resolution, but it should work universally. Therefore, I would like to focus on some of the capabilities that also allow desktop web applications to have some superpowers. But let's start with some basics.

The underlying question for web apps running both on desktop and mobile is, what problems do they need to solve to offer a truly comparable user experience? First of all, they should be fast, because we don't want to have a loading spinner if you click on an application or on a file. It should be there immediately. It should be integrated, so it should feel like it's part of the operating system, an extension of the operating system. It should be reliable, even if we have no internet connection or bad internet connection, we should be able to use the app. And it should be engaging, so we should be able to re-engage our users, for example, using push notifications. To solve those problems, browsers had to introduce two new core concepts, the Web App Manifest and the Service Worker.

The Service Worker, sorry, the Web App Manifest is basically just a JavaScript, a JSON file that contains information about the application. We, first we need to register the manifest, it's basically one line of HTML pointing to the file, and then the file itself contains information like the title, short name, description, colors, and that's already it. So my browser, in this case, Edge, knows that we now have an installable PWA, and it offers us to install it. There are more and more capable properties that we will look into in this talk.

2. The Service Worker and Network Independence

Short description:

The Service Worker is a piece of JavaScript that lives in a separate scope and is able to listen to events, interact with the site, and stay active even if the browser is closed. We can register the Service Worker and define its scope. Inside the Service Worker, we have event listeners for Install, Activate, Fetch, and Push events. The Service Worker allows our super web app to remain functional even without an internet connection, as it sits between the website and the internet and can interact with the application storage.

The second big thing is the Service Worker. So first of all, my app is a JavaScript application, so there's a lot of application logic written in JavaScript, which is cool because I really like JavaScript. Then again, as soon as we close the site, as soon as we close the browser, there's just, JavaScript is just dead. There are no things happening inside our app.js anymore, so we can't interact with it anymore.

The Service Worker is now also a piece of JavaScript, but it lives in a separate scope. It's registered between the web app and the browser, and there it is able to listen to events, to interact with the site, even if the browser is closed, so it stays there forever. It's not bound to the lifecycle of our application.

To register the Service Worker, we can call this navigator.serviceworker.register function, points to the Service Worker. It has some optional parameters like the scope, so in our case, our Service Worker controls everything, so our site and all the subfolders as well. We can also create a new Service Worker that controls specific scopes inside our application, so we could have the About Service Worker that only controls everything inside this About folder, for example.

And then, inside the Service Worker, it's just JavaScript. We do have event listeners, so whenever someone visits the page, this Install Event is fired. Then once the installation happened, we have the Activate Event. Then every request goes through the Service Worker with the Fetch Event, and also if someone tries to reach our Service Worker from some server, for example, we do have the Push Event that we can listen to. So far, so good.

But let's get back to our super web app and its superpowers. Let's start with issue number one, Super Web App and the dream of network independence. It's a beautiful day, sun is shining, our super web app tries to request some assets from the server, it makes a request to the server, comes back with the response, everything was fine. But suddenly, the internet connection is gone. Sorry, there we go. Different. The internet connection is gone, and well, Donasaur appears, certain death for all classic web applications. Not so for our super web app, because we do have the Service Worker superpower.

Now the Service Worker sits between the website and the internet, and it can also interact with the application storage. So even if the internet connection is gone, we still have a reliable source to serve our request. How can we use it? So in this case, we have our SVG, we have a fallback SVG image and we want to show the fallback SVG whenever a request to an SVG image fails. First of all, in the install event, we opened the cache, we will then put this fallback SVG into the cache. Then once we have the fetch event, we will first check whether the requested asset is actually an SVG. If that is the case, we do have the event.responseWith, which basically takes over the request. There we can then pass the request to the server.

3. Caching and Data Storage

Short description:

If an image request fails, we can return the cached image. Workbox.js is a tool that helps with caching and intercepting network requests. We have options like session and local storage for storing data, but for more data, we can use IndexedDB or the Origin Private File System API.

But if it fails, if there is to catch, we can return the image that is already cached. Another example would be where we have a, let's say an offline first image cache. In that case, we want to catch all image requests. We will take over the response. We will then check whether we have that request already in cache. If that's the case, we will just return it right away. So that is just super fast. If not, we will fetch the data from the server. We will then clone the response. We can then cache the response and we will return the response. So next time we will request the same URL, it will be returned directly from cache, which is immediately.

Now there is one tool that helps us with that, that's Workbox.js. It's basically an abstraction on top of the Service Worker and the caches API. There are basically plugins for all kinds of use cases. There are also integrations for all kinds of build systems. And yeah, it just makes it super easy to use the Service Worker cache. The Service Worker cache is amazing because it allows us to cache or to directly intercept network requests on a very low level. But then again, another common problem is that we need data that is maybe stored. We need to store data inside our application logic. So that could be data generated by the application. Could be data from a REST API where we want to have a more structured way to cache those entries. And there we have multiple possibilities. We do have the session and the local storage. Both are simple key value pairs. Session storage is only for one session. Local storage persists over several sessions, but they are both quite limited in size. So we can only store around 5 megabytes. If you have more data to store, we can use, for example, the IndexedDB where we have this low level browser API that allows web applications to store and manipulate large amounts of structured data. We can even do querying and indexing on top of that data. And then we have the Origin Private File System API, which allows us to create, read, and update files in a private file system, which means that it is part of the user's file system, but it's not visible by the user or any other origin than our web application.

4. Persistent Storage and File Handling

Short description:

The Persistent Storage API allows us to store data for web applications. The amount of data we can store depends on the browser and operating system. The File System Access API enables reading and writing files on the client's device. We can get a file handle through the show open file picker method or from the IndexedDB. Permissions for file handling are session-based and can be upgraded to read-write. The file handling API allows web apps to directly open files.

The other question, how reliable is data stored for a web application? So we do have the Persistent Storage API. It's an API that allows us to request permission to persistently store data for a web application.

The other big question is how much data can we store? The good thing is, at least, it always depends on the browser and the operating system, but at least on Chrome and Edge, on Windows, we can basically store as much data as we have stored, we left on our device. So if you have 500 gigabytes on our device, we can basically use 500 gigabytes of data for our web application.

Yeah, which brings us to our next issue in the series, SuperWebApps Data Dive into the File System ABIS. It has always been possible to read the blob of a file using the file input element, and after that, it was also possible to provide a download link to the file, but that's it. So no further interaction with the file system was possible. The File System Access API tries to change that. With this API, it is now possible to read files or whole directories on the client's device, and furthermore, it's also possible to write changes back directly to that file. So whenever you want to interact with a file, we now need to have a file handle.

There are basically two ways to get the content of a file. In the first scenario, we already have a file, sorry, we don't already have a file handle. So here we use this show open file picker method, which opens a file picker dialogue and allows the user to select one or more files. After that, the user sees this prompt here on the right-hand side asking for permission where we need to confirm that the web app is allowed to handle a file, and one great aspect is that those handles, they are serializable. So we can store them, for example, in the IndexedDB.

In the second scenario, we already have the handle, maybe from the IndexedDB, but permissions are only granted for one session. So once we close the app, we need to request permission again. In this case, I only need to read permission. After that, I am again able to get the file and read the content and we're good to go. After that, we also want to write content back to the file. So first of all, we need to upgrade our permissions. We now need to read write permission. We can then create a writeable, write content to the writeable, close the writeable, and that's already it. It's saved on our file. Simple as that.

Then again, do we really want to open an app, select the file inside the app, and then open the file? It's possible, but not very convenient. When we open a Word document, for example, you just double click on the icon. It opens Word with the document already opened. So why shouldn't we be able to do the same with web apps? Which leads to our third issue, the file handling revolution. The idea of the file handling API is that once a web app is installed, we can use the web app to directly open files.

5. Project Fugu and File Handling

Short description:

We can use the web app as a default app for a certain file type using the file handling property. The launch queue API allows us to receive incoming files. Project Fugu is a cross-organization project to bridge the gap between native apps and web applications. It provides a list of new APIs, including the local font access API, which allows access to locally installed fonts.

We can then even use the web app as a default app for a certain file type. So when the user double clicks on the file, it will open in the web app. And this is all possible using this new file handling property in the manifest. Here we can define the file types that our app can handle. In this case, we do want to handle Markdown files together with an action that works similar to a form action, basically. It also means that we can use the same web app for different file types. For example, we could also use the same web app for text files as well, with a different or also with the same action.

Inside our application, we can then use the launch queue API to receive an incoming file. So file handling API triggers the action and the launch queue API then consumes the file. And that's already it. It's a pretty simple API for us developers, but it's extremely convenient for the user.

That was a lot of tech content for now, right? Let's get back to our DC superheroes. Does anyone know the name of this iconic trio? That's Trinity. So whenever Superman had a problem that was too big for him alone, he called Wonder Woman and Batman the train forces. In the web land, we don't have Trinity, but we have something even better. We have Project Fugu. Project Fugu is a cross-organization project mostly by Google, Microsoft and Intel to bridge the gap between native apps and web applications. So let's open issue number four, the epic kitchen battle taming the Fugu.

The name of the project is based on the Fugu fish, which is supposed to be a delicacy. I can't judge because I never tried it, but it's also extremely dangerous to prepare. So the core of the project Fugu is a list of new APIs that supposed to bring the web closer to native apps. But we also need to be careful how it's implemented and how we can use it. There are quite a lot of new APIs, for example, APIs that allows us to interact with hardware devices. There are APIs that we have already discussed, like file system access and file handling. And there's a whole bunch of new APIs. And always some of them are an origin trial. Some of them are in development. So you should check the tracker before you use them. But there's one API that was particularly useful for MD edit and that's the local font access API because the API allows us to access the user's locally installed fonts. So as you can see here on the left hand side, we can call the window query fonts, which will then show a prompt to the user asking for permission to access the fonts.

6. Using MD edit and Font Access API

Short description:

If granted, you will receive an array of font objects. MD edit allows opening and editing markdown files. It can save content directly to files and be installed as an application. The font access API enables changing fonts, and MD edit can be set as the default application for opening Markdown files. Companies like VS Code are already using these APIs.

If granted, you will then receive an array of font objects. This allows me then to create a select box or the user can select a font which sets a custom CSS variable that is responsible for the markdown or the specific editor.

So for now, our heroes scratched the surface of a lot of new superpowers, but let's open issue number five, where the superhero unites all powers for some outstanding demos. First of all, I have MD edit. So there we go. What I do have in here on my local system is I have a markdown file, which I can open with editor. And as you can see, it's basically just some information about React Summit.

What I can do then is I can open that in MD edit, same file from the desktop. There we go. And I can say, for example, hello world. And I can then save content. Yes, I do want to do that. If I now open the app, you can see that it is saved directly on our file. Pretty cool, pretty convenient, but we can go even further. We can now install the application. Takes a couple of seconds. There we go. And now we can see that it's opened directly in the, let's say, the layout that we specified. I can now close it. I can now say, well, let's go here. Open that with MD edit. There we go. And we can now open the file directly with MD edit. I can now also use the font access API to, let's say, change the visivic font to, there you go, something different and so on and so forth. And last but not least, I can also say that I always want to use MD edit to open Markdown files. So whenever you can see that the icon already changed. And when I double click on that, it's open directly in MD edit, in our application. That is pretty cool. Now, in addition to my own experiments, let's close that, there are also big companies that are already using those APIs. For example, VS Code, where we have the whole Visual Studio Code experience directly in the browser.

7. Progressive Web Apps and Cross-platform Solutions

Short description:

Clipjam and Adobe Invest provide video editing and Photoshop for the web. The need for write once, run everywhere has existed since the beginning of development. Java and Electron had limitations, but Progressive Web Apps offer accessible, integrated, offline solutions that are small compared to cross-platform options. Thank you for your attention!

We have Clipjam, that is a whole video editing platform directly in the browser. And even Adobe Invest, we do have Photoshop for the web. So a lot of the APIs that you've seen or a lot of the features that Photoshop provides are also available in Photoshop web.

To sum it all up, the idea to have an application that you run once and then it runs every, or that you write once and runs everywhere, has been a huge need for developers since the beginning of development, I would say. For a long time, we thought that maybe Java would be the solution. And I think write once and run everywhere was also the slogan of Java at one point, until we figured out that it sucks at creating UIs.

There's also Electron, where we have our browser, or we have the browser engine together with the application, that also means that we will ship the whole browser engine with every application we write. And we have multiple instances of, for example, Chrome installed on our device. Now we try to solve that. But then again, we do need to ship. So we do have the whole detour via the installation process. And now with Progressive Web Apps, we have solutions that are accessible via URL, that is deeply integrated with the OS. It works offline and it's just incredibly small compared to all the cross-platform solutions.

So with that, thank you so much for your attention. My slides are behind that QR code. If you have any questions, I'm happy to answer them in the Discord channel. Well, until next time, I hope you have a great time. And thanks again so much for your attention. Bye.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Domain Driven Design with Vue Applications
Vue.js London 2023Vue.js London 2023
14 min
Domain Driven Design with Vue Applications
Top Content
Welcome to this talk on domain-driven design in Vue.js application. Today we are going to look into domain-driven design, its benefits and how it works with Vue.js domain-driven design versus the MVVM model. Vue.js thrives in domain-driven design, a design approach that models software to match a domain. DDD emphasizes understanding business logic and creating a domain that reflects the language and concepts. Integrating DDD in Vue.js offers benefits such as effective modeling of complex business domains, structured code reflecting domain logic, and easier onboarding and ownership.
No Seriously: htmx is Pro-JavaScript!
JSNation US 2024JSNation US 2024
29 min
No Seriously: htmx is Pro-JavaScript!
Watch video: No Seriously: htmx is Pro-JavaScript!
HTMX is a hypermedia-oriented front-end library that enhances HTML as a hypermedia. It generalizes the concept of hypermedia controls in HTML, allowing any element to become a hypermedia control. HTMX provides practical attributes like HX swap and HX indicator. The active search demo showcases the dynamic behavior achievable with HTMX. HTMX allows developers to build web applications without writing a ton of JavaScript. It works well for traditional web apps but may not be suitable for offline functionality or fast interactions. HTMX can be integrated with JSX and various backend stacks, and TypeScript can be used alongside HTMX.
How to Share Code between React Web App and React Native Mobile App in Monorepo
React Summit 2022React Summit 2022
7 min
How to Share Code between React Web App and React Native Mobile App in Monorepo
This presentation focuses on sharing code between React web and React native mobile apps. The speaker demonstrates how to achieve feature parity using a Monorepo with NX. They highlight the importance of sharing non-UI code, such as business logic and state management, through shared libraries. This approach allows the apps to focus on UI code while keeping non-UI code separate. For more details, refer to the speaker's blog post.
Data Loaders - Elevating Data Fetching in Vue
Vue.js Live 2024Vue.js Live 2024
30 min
Data Loaders - Elevating Data Fetching in Vue
Data loaders provide a solution for complex and repetitive data fetching in Vue.js applications. Using data loaders allows for more independent data fetching and integrates with the navigation cycle. The data loader plug-in adds a navigation guard for data fetching and loading. Lazy loading and caching can be implemented using Pina Colada and Glada loaders. These loaders can improve the performance and speed of data fetching in applications.
The Next Wave of Web Frameworks is BYOJS
JSNation 2022JSNation 2022
23 min
The Next Wave of Web Frameworks is BYOJS
The next wave of web frameworks is BYOJS, covering the history and evolution of building web applications. The evolution of web frameworks and build systems includes popular choices like React, Angular, and Vue, as well as advanced build systems like Webpack and Rollup. The rise of performance measurement tools and the adoption of the Jamstack have led to improved web performance. The Jamstack architecture focuses on pre-rendering pages, decoupling APIs and services, and enhancing pages with JavaScript. Astro, a static site generator with SSR support, promotes the islands architecture and partial hydration.
MIDI in the Browser... Let's Rock the Web!
JSNation 2022JSNation 2022
28 min
MIDI in the Browser... Let's Rock the Web!
MIDI is a versatile communication protocol that extends beyond music and opens up exciting possibilities. The Web MIDI API allows remote access to synths and sound modules from web browsers, enabling various projects like music education systems and web audio-based instruments. Developers can connect and use MIDI devices easily, and the Web MIDI API provides raw MIDI messages without semantics. The WebMidi.js library simplifies working with the Web MIDI API and offers a user-friendly interface for musicians and web developers. MIDI on the web has generated significant interest, with potential for commercial growth and endless possibilities for web developers.

Workshops on related topic

Web Accessibility in JavaScript Apps
React Summit 2022React Summit 2022
161 min
Web Accessibility in JavaScript Apps
Workshop
Sandrina Pereira
Sandrina Pereira
Often we see JavaScript damaging the accessibility of a website. In this workshop, you’ll learn how to avoid common mistakes and how to use JS in your favor to actually enhance the accessibility of your web apps!
In this workshop we’ll explore multiple real-world examples with accessibility no-nos, and you'll learn how to make them work for people using a mouse or a keyboard. You’ll also learn how screen readers are used, and I'll show you that there's no reason to be afraid of using one!
Join me and let me show you how accessibility doesn't limit your solutions or skills. On the contrary, it will make them more inclusive!
By the end, you will:- Understand WCAG principles and how they're organized- Know common cases where JavaScript is essential to accessibility- Create inclusive links, buttons and toggleble elements- Use live regions for errors and loading states- Integrate accessibility into your team workflow right away- Realize that creating accessible websites isn’t as hard as it sounds ;)
How to Create a Web Application in an (Almost) Autonomous Way Using Clean Coder
Productivity Conf for Devs and Tech LeadersProductivity Conf for Devs and Tech Leaders
95 min
How to Create a Web Application in an (Almost) Autonomous Way Using Clean Coder
Workshop
Grigorij Dudnik
Grigorij Dudnik
Imagine replacing yourself with a multi-agent AI programmer to develop your production web application. That's exactly what we did at my startup takzyli.pl. To achieve this, we designed and used the Clean Coder - AI agent framework for autonomous code writing (https://github.com/GregorD1A1/Clean-Coder-AI), which is hopefully open-source project. If it worked for us, why shouldn't it work for you?In this workshop, I'll show you how to create an entire web application in an (almost) autonomous way and drastically reduce the time you or your employees spend on writing code.
Build a Universal Reactive Data Library with Starbeam
JSNation 2023JSNation 2023
66 min
Build a Universal Reactive Data Library with Starbeam
WorkshopFree
Yehuda Katz
Yehuda Katz
This session will focus on Starbeam's universal building blocks. We'll use Starbeam to build a data library that works in multiple frameworks.We'll write a library that caches and updates data, and supports relationships, sorting and filtering.Rather than fetching data directly, it will work with asynchronously fetched data, including data fetched after initial render. Data fetched and updated through web sockets will also work well.All of these features will be reactive, of course.Imagine you filter your data by its title, and then you update the title of a record to match the filter: any output relying on the filtered data will update to reflect the updated filter.In 90 minutes, you'll build an awesome reactive data library and learn a powerful new tool for building reactive systems. The best part: the library works in any framework, even though you don't think about (or depend on) any framework when you built it.
Table of contents- Storing a Fetched Record in a Cell- Storing multiple records in a reactive Map- Reactive iteration is normal iteration- Reactive filtering is normal filtering- Fetching more records and updating the Map- Reactive sorting is normal sorting (is this getting a bit repetitive?)- Modelling cache invalidation as data- Bonus: reactive relationships
Build Web3 apps with React
React Summit 2022React Summit 2022
51 min
Build Web3 apps with React
Workshop
Shain Dholakiya
Shain Dholakiya
The workshop is designed to help Web2 developers start building for Web3 using the Hyperverse. The Hyperverse is an open marketplace of community-built, audited, easy to discover smart modules. Our goal - to make it easy for React developers to build Web3 apps without writing a single line of smart contract code. Think “npm for smart contracts.”
Learn more about the Hyperverse here.
We will go over all the blockchain/crypto basics you need to know to start building on the Hyperverse, so you do not need to have any previous knowledge about the Web3 space. You just need to have React experience.