- Caches data, and
- Works offline
Both of these things are pretty much basic prerequisites to call something a PWA. However, this project has some extra bells and whistles that make it really progressive. It:
- Uses ReactDOM's streaming renderer on the server to provide streaming HTML responses that leverage the browser's streaming HTML parser
- Uses its serviceWorker to intercept requests for data and returns more streaming HTML when a request is made.
This makes the entire application a truly streamed application that delivers data incredibly fast (fastest I've seen).
The project itself is fairly trivial: it is a simple book search, that queries Google's Public Books API and returns books that you search for. The interesting part is that it returns streams, that are then processed in the client.
The even more interesting part is that if the repsonses are cached, the service worker returns the stream instead, creating a
1-4ms request-response cycle for all of this data. This is pretty cool.
git clone firstname.lastname@example.org:TejasQ/basically-streams.git
The app will be accessible on
This is part of my Basically series that seeks to make concepts that could be scary to newer developers accessible and easy to grasp, in order to empower, enable, and inspire developers to create beautiful things all over the internet.
I hope this helped you. :)
This project is but a small part of a larger project called Basically, Streams. If this interests you, be sure to check out the other examples and documentation!
The 2 points I lost on the Lighthouse Report above are because the CSS and JS are large and well documented. A trade-off I am happy to make. Go check out the source code!