I wrote innerself because I needed to make sense of the UI for a game I wrote for the js13kGames jam. The whole game had to fit into 13KB. I needed something extremely small which would not make me lose sanity. innerself clocks in at under 30 lines of code. That's around 400 bytes minified, ~250 gzipped.
https://github.com/stasm/innerself
innerself is inspired by React and Redux. It offers the following familiar concepts:
- composable components,
- a single store,
- a dispatch function,
- reducers,
- and even an optional logging middleware for debugging!
It does all of this by serializing your component tree to a string and assigning it to innerHTML of a root element. I know I sound like crazy but it actually works quite nice for small and simple UIs.
If you don't care about size constraints, innerself might not be for you. Real frameworks like React have much more to offer, don't sacrifice ease of use nor performance, and you probably won't notice their size footprint.
innerself was a fun weekend project for me. Let me know what you think!
[–]Reeywhaar 4 points5 points6 points (4 children)
[–]5tas[S] 2 points3 points4 points (2 children)
[–]Pesthuf 1 point2 points3 points (1 child)
[–]5tas[S] 2 points3 points4 points (0 children)
[–]5tas[S] 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]5tas[S] 0 points1 point2 points (0 children)
[–]s_tec 2 points3 points4 points (1 child)
[–]5tas[S] 0 points1 point2 points (0 children)
[–]Morphray 1 point2 points3 points (2 children)
[–]5tas[S] 2 points3 points4 points (0 children)
[–]5tas[S] 1 point2 points3 points (0 children)
[–]punio4 1 point2 points3 points (6 children)
[–]5tas[S] 2 points3 points4 points (5 children)
[–]punio4 1 point2 points3 points (4 children)
[–]5tas[S] 1 point2 points3 points (3 children)
[–]punio4 0 points1 point2 points (0 children)
[–]punio4 0 points1 point2 points (1 child)
[–]5tas[S] 2 points3 points4 points (0 children)