Allows you to change the underlying data model with state
There he says "When compared with Web Components, React has the following advantages: Thanks for the questions :) Like comment: Like comment: 2 likesĪfter further research the developer of CodePen wrote an article: /web-component-why-y. In my personal opinion, modern CSS is great and doesn't need any help from pre-processors my rollup-plugin-lit-css and esbuild-plugin-lit-css help smooth that process out. Yes, you can use CSS preprocessors with Lit or other web components libraries, but it will add complexity. That being said, you are perfectly able to use web components written in stencil inside your Lit components and vice-versa In my personal opinion, I prefer Lit over Stencil because Lit is oriented more as a set of additional features on top of platform features, whereas Stencil is oriented more as a framework. See the ClockController example and adapt to use asynchronous fetch() calls. For your stock ticker example, you could write a reactive controller which updates the host with stock prices based on API calls. You can use a "light DOM as data" approach, assign DOM properties, or use stringified attributes, depending on what works for you. Sure, web components have a variety of means of accepting complex data of any variety. #webcomponents #nextjs #typescript #usetheplatform Then go straight to learning NextJS and adding my UI to NextJS apps.Ĥ) Can I use StylusCSS when making my Lit custom UIs? If so how (I want to write them using html + typescript + stylus syntax)!? Like comment: Like comment: 1 like IF Q 1 and 2 = True, I will learn a web component lib instead of react.
OR a more complex example is UI widget that displays the stock price in the last week from our DB as a line chart, Will this UI element be able to fetch the 'value' data from our and 'key' data from our backend frameworks DB or will it just appear blank and we have to somehow hook them together? I got the impression in your intro blogs that the dev or user defines the data displayed in a customer element - in this would it would mean each UI element is rendering as a 'static elements', is this assumption wrong?.ģ) Your 'lets build web components 8parts' series did not cover StencilJS, why? I wanted to hear your thoughts of Stencil vs Lit - because I considered defaulting to Ionic UIs (which I think can be tweaked with stencil) and creating my own with stencil/lit when Ionic doesn't fit my UI needs. Can we now create a custom UI element that displays the 'current' which updates every minute from data in our DB rather than interactive user input data.
our DB stores and that update every minute. Do you mind clarifying these elementary points please? So I know that I'm on the correct learning path and don't lose 6months on something that may not work.Ĭan web components (in an easy way without thousands of dependencies).ġ) Be used in frameworks like NextJS or does it only work on client side rendered things like react/angular/vue? OR do we not even need a front end library and just use the web components UI (this confuses me, is it web components + Next or web components + nothing)?Ģ) Can they be dynamic and use long lists of data from our backend in our custom UI elements? e.g. I'm a baby dev considering if I should learn web components using Lit. Import React, element is recomputed and the corresponding DOM element is then updated.Excuse me Benny.