January 2023

22 bookmarks saved in January 2023

Embedding Our New React UI in Go | Flipt Blog

https://www.flipt.io/blog/embedding-react-in-go
The UI is served over HTTP directly from the binary using Go’s fantastic http.FileServer implementation from the standard library. Sometime around February 2021 was the Go 1.16 release, which came with native embedding of files into Go binaries. Flipt quickly took advantage of this feature for bundling the static UI assets directly into the binary. Go has a handy wrapping function that adapts the embed.FS into the required http.FileSystem interface to integrate it seamlessly into an http.Server. You can find the current (v1.16.0) embed directive in Flipt here.

SQLite as a document database

https://dgl.cx/2020/06/sqlite-json-support
This makes it possible to insert JSON straight into SQLite and then have it extract data and index them, i.e. you can treat SQLite as a document database. This has been possible with PostgreSQL and obviously is what something like Elastic provides but having it available in an embedded database is very nice for lightweight stuff.

Tree views in CSS

https://iamkate.com/code/tree-views
A tree view (collapsible list) can be created using only HTML and CSS, without the need for JavaScript. Accessibility software will see the tree view as lists nested inside disclosure widgets, and the standard keyboard interaction is supported automatically.