Investigate using Service Workers for Clientside Live Preview

Description

After an interesting conversation with the Codesandbox team, we were presented with a possible solution to #197206 (closed):

  • Use service workers as a "proxy" to these static assets.

This would be really nice because we can avoid the infrastructure requirements since it will all be client side. There are some interesting challenges though:

  • The service worker needs to be loaded in a separate unauthenticated domain. How can it make requests to file data then?
  • What happens when someone has two IDE's open? Do service workers effect the entire browser session or just that tab? Is there a way we can scope the worker to the specific ide session?

Diagram

Screen_Shot_2020-05-19_at_11.01.03_AM

Links

  • (INTERNAL ONLY) Discussion doc: https://docs.google.com/document/d/1-6SCcux21PIvU5oIvNaZg2ddep0n9W8k0LEYT0pzrVE/edit
Edited May 19, 2020 by Kai Armstrong
Assignee Loading
Time tracking Loading