Our great sponsors
-
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:
-
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).
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
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.
Related posts
- F360 going crazy over a client supplies SVG. Anything to clean it up?
- What is the benefit of stripping viewBox?
- Создаем React-компоненты иконок с помощью Figma API и SVGR. Часть 2.
- Used an online SVG editor, this code got added to my file. I've already opened the file. How fucked am I?
- Using SVGs in Common Lisp web apps with Djula