News for hackers. Stuff that matters.

simonfan

Re:Show HN: Service Workers and IndexedDB based IDE on Thursday March 09, 2017 @05:56PM (#13834622)
Hey everyone,

we've built an offline (highly experimental) version of our code editor on top of Service Workers and IndexedDB.

Basically, the service worker intercepts all requests for /preview//*, fetches files from the IndexedDB and passes them through a series of express.js middleware, everything inside the browser. Live code inspection is enabled via window + service messaging.

The most interesting concept in this project was to bring some server-side logic into the browser, specifically into the service worker, e.g. running css-autoprefixer through all CSS code before serving it.

Works on Chrome and FF.