panel
web-components-examples
panel | web-components-examples | |
---|---|---|
1 | 3 | |
272 | 2,973 | |
0.4% | 0.8% | |
5.7 | 4.7 | |
3 months ago | about 2 months ago | |
JavaScript | JavaScript | |
- | Creative Commons Zero v1.0 Universal |
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.
panel
-
Web Components Will Outlive Your JavaScript Framework
Webcomponents will outlive React 13, mostly likely. Will they outlive React entirely or its cousins like Solid and Svelte? Perhaps not.
Webcomponents and React look like they solve the same problem but they do not.
Webcomponent api is pretty shallow. You get connected/disconnnected/attributeChanged call back but gotta write your own property setter and getters, and that’s mostly it. Shadow dom becomes a pain to work with if something needs to pierce it. Can’t pass nested objects in attributes, gotta encode as string.
Mixpanel went all in on webcomponents, but had to build a whole bunch of lib tooling around it. They made their own framework on top of webcomponents. https://github.com/mixpanel/panel
Worked on panel lib and webcomponent UI for many years. It is not a silver bullet.
The issue with webcomponents is there are a ton of libraries that fill in the missing gaps. There’s not a lot you can do with pure vanilla webcomponent api since browsers don’t provide efficient dom updating mechanism. Google has their own thing, Microsoft had multiple internal libs across orgs, Reddit does their own thing.
The most standard thing for frontend with wide adoption right now is React.
So the way I see it, is that React has already outlived webcomponents.
web-components-examples
-
Web Components Will Outlive Your JavaScript Framework
I was excited for web components, but the API was lacking (the final tipping point that led me to build Joystick [1]). I just couldn't get on board with a web-standard that eschewed HTML in favor of stuff like this [2] where list items are attributes. The hyphenated namespace thing has always made my eye twitch, too (silly, I know).
[1] https://github.com/cheatcode/joystick
[2] https://github.com/mdn/web-components-examples/blob/main/edi...
-
How is Web Components used with React?
I just found out about Web Components and read that they can be used complementary with React. This concept of Web Components are new to me as I thought only library/frameworks were used to create re-usable component. I'm just wondering how are Web Components used in modern frontend development and if there are any examples that I can refer to such as github or codepen where Web Components are used within React. So far I found this example from MDN: https://github.com/mdn/web-components-examples
-
can i share web components across pages?
Second, you’ll just import the JavaScript file where you’ve defined your web components into each html file. Example.
What are some alternatives?
lit-state - Simple shared component state management for LitElement.
nonio-frontend
lit - Lit is a simple library for building fast, lightweight web components.
router - Small and powerful client-side router for Web Components. Framework-agnostic.
flyctl - Command line tools for fly.io services
joystick - A full-stack JavaScript framework for building stable, easy-to-maintain apps and websites.
live_state - The hex package for the server side of live state
uibuilder - Typed HTML templates using TypeScript's TSX files