Lit Web Components performance with attributes vs slots #4642
Replies: 2 comments 4 replies
-
I appreciate the concise description, but we'll probably need a bit more information. Perhaps you could provide an example (a playground would be great) showing the technique you're using to configure the element via JSON. Please don't provide a complicated element, but a subset of one showing the general pattern(s) you're using would be helpful. |
Beta Was this translation helpful? Give feedback.
-
Personaly i would set Json using methods and/or propertys never as attributes because they are stringify versions of the object you want to pass down. setting big strings as attributes aka is pretty limited in readablity in the dom and are probably slower. unlike in the past with IE i think you can set very big strings as attributes but the conversion is needed if you want to work with them as a object |
Beta Was this translation helpful? Give feedback.
-
We have developed a lot of web components for apps to reuse. Few components are simple and few of them are complex. Mostly Complex components apps pass big/nested JSON config as attributes as most of the logic is handled by the component itself. Eg: Nested nav or pagination and it's controls or table and it's sorting etc. Will there be any impact on the performance with this JSON attribute approach vs passing as a slot. How can we better improve lit web components performance.
Beta Was this translation helpful? Give feedback.
All reactions