You are viewing archived messages.
Go here to search the history.

Tony O'Dell 2021-12-20 17:07:44
Benjamin Smith 2021-12-22 03:29:49

Hi all! New here, I wanted to share something I made over the weekend that I thought some people here might find interesting/have thoughts on. It's a self-hosting web code editor that stores and edits "files" in the browser's IndexedDB and uses a service worker to serve them as if there was an actual backend. You can try it out here (only works in Chromium-based browsers because it uses ES modules in the worker): https://reflection-editor.netlify.app/ Source code is also available at https://github.com/Merlin04/reflection.

Florian Schulz 2021-12-22 15:33:14

Clever!

Tony O'Dell 2021-12-22 17:10:17

đź“· image.png

Benjamin Smith 2021-12-22 17:28:53

That's odd, are there any errors in the console?

Matthew Linkous 2021-12-23 15:14:51

Is there a way to evaluate/run the code?

Tony O'Dell 2021-12-23 18:02:26
Uncaught (in promise) TypeError: ServiceWorker script at [https://reflection-editor.netlify.app/worker.jsm](https://reflection-editor.netlify.app/worker.jsm) for scope [https://reflection-editor.netlify.app/](https://reflection-editor.netlify.app/) threw an exception during script evaluation.
Benjamin Smith 2021-12-24 01:44:05

@Matthew Linkous Right now there's just editing the source and saving/reloading to run the changes, but that would be a useful feature to add for individual script files!

Benjamin Smith 2021-12-24 01:44:42

I'm not sure how I could troubleshoot that script error, I'm going to try to make it not use ES modules in the worker which should reduce compatibility issues

Florian Schulz 2021-12-24 10:30:13

I haven’t worked with Service Workers, so this is a more general question: would it also be possible to serve images (stored as DataURI) from IndexedDB and have them appear in the network/resources tab (e.g. as my-file-from-indexeddb.png)?

Florian Schulz 2021-12-24 11:16:16

In response to my own question: yes, it is possible to use Service Workers to serve “virtual” synthetic image files from IndexedDB or memory. This is really cool!

Tony O'Dell 2021-12-22 22:09:27

A childhood friend of mine and I wrote a package manager as a side project for a programming language. As a follow on for it I wrote a module authoring tool to make packages available for everyone and did a little write up of how authoring modules in that language is done: https://deathbykeystroke.com/articles/20211222-the-life-of-raku-module-authoring.html