lit-state
lit-state | nonio-frontend | |
---|---|---|
3 | 1 | |
137 | 21 | |
- | - | |
0.0 | 7.1 | |
over 1 year ago | 28 days ago | |
JavaScript | JavaScript | |
GNU Lesser General Public License v3.0 only | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
lit-state
-
Web Components Eliminate JavaScript Framework Lock-In
The reason React uses a virtual DOM is because when React started, there were no (advanced) HTML templates yet. And it made it easy to setup listeners on elements, instead of manually adding it with `addEventListener()` and possibly remove them again with `removeEventListener()`. So the virtual DOM was really a game changer.
But Lit templates solve this problems in a more browser integrated way, without the need of a virtual DOM. How you manage the state is free to your choice, that is also not something exclusive to React and your favorite pattern can also be used with Lit. I wrote a tiny state management library (LitState [0]) which makes it very easy for multiple components to share the same state and stay in sync. I personally find it much more convenient and cleaner than any other state library I've used before. And it integrates very nicely with Lit.
[0]: https://github.com/gitaarik/lit-state
- Web Components Will Outlive Your JavaScript Framework
- Litstate Simple Shared App State Management For
nonio-frontend
-
Web Components Will Outlive Your JavaScript Framework
> Finally, the last thing I would suggest is that writing an entire app in vanilla web components is kind of crazy talk in my opinion. For 5kb you can have a super nice developer experience using Lit (https://lit.dev)
I 100% agree with this. For me it was more of a question of "can I do it", and that was something I wanted to find out. You notice that I ended up having to recreate a significant chunk of lit-like functionality on my own via a base class: https://github.com/jjcm/nonio-frontend/blob/master/component...
I would very much recommend not going full vanilla. Using a library like lit will definitely help making things easier/more polished, and will integrate better with existing tooling.
What are some alternatives?
lit - Lit is a simple library for building fast, lightweight web components.
web-components-examples - A series of web components examples, related to the MDN web components documentation at https://developer.mozilla.org/en-US/docs/Web/Web_Components.
kor - User Interface Component Library based on LitElement / lit-html
joystick - A full-stack JavaScript framework for building stable, easy-to-maintain apps and websites.
panel - Web Components + Virtual DOM: web standards for powerful UIs
uibuilder - Typed HTML templates using TypeScript's TSX files
lrnwebcomponents - HAXTheWeb monorepo of elements and apis
router - Small and powerful client-side router for Web Components. Framework-agnostic.
WebComponentFactory - Make use of JavaScript web components while keeping your code in .html for LSP features
lit-style - Shared component styles for LitElement