Alicia Rojas - Building an offline experience with a Rails-powered PWA - Rails World 2023

Key takeaways
  • PWAs are web applications that are progressively enhanced with modern APIs to deliver enhanced capabilities.
  • PWAs can improve reliability by providing offline access and other features.
  • The main ingredients required to turn a Rails application into a PWA are a service worker, a manifest, and indexed DB.
  • Service workers are small applications that run in parallel to the main Rails app, intercepting requests and providing capabilities such as offline caching and background sync.
  • Indexed DB is a JavaScript API for managing a database of JSON objects in the browser.
  • Hotwire Stimulus is a JavaScript library that allows for easy creation of interactive web applications.
  • To enable offline support, you can use indexed DB to store data locally and sync it with the server when the user is back online.
  • It’s important to make sure that your frontend validations match the backend validations to prevent errors.
  • PWAs can be a great way to reach unconventional audiences and deliver a seamless offline experience.