
-
It's not enough though, since I wanted to give an option to change theme. To achieve that I've created ThemeProvider component that wraps entire application and provides theme value via react context. To get theme in any component all I need is to call useTheme hook:
-
SurveyJS
JavaScript Form Builder with No-Code UI & Built-In JSON Schema Editor. Add the SurveyJS white-label form builder to your JavaScript app (React/Angular/Vue3). Build complex JSON forms without coding. Fully customizable, works with any backend, perfect for data-heavy apps. Learn more.
-
xooks – React hooks library that includes all hooks that I've used during Omatsuri development (localstorage manipulations, system theme detection, clipboard utils and six others).
-
There is actually only one good library for SVG compression (SVGO) written in JavaScript. And it does not have browser support, only Node.js. I found it very strange as compression is based entirely on string parsing and does not include any node specific logic.
-
I was surprised how easy it is to work with web workers in webpack. All you need is worker-loader that will handle all worker bundling for you.
-
Since Omatsuri is a browser only application the only thing that we need from service worker is to cache assets and provide app shell. Offline plugin does exactly that, the only thing we need to do – add it to the production build in webpack config:
-
So my first task was to migrate SVGO to browser. It was pretty easy, since all core logic did not require any modifications. And now you can use svgo-browser library in your projects if you ever need SVG compression in browser.