Hacker News new | past | comments | ask | show | jobs | submit login

Reddit rewrote a small part of their website with web components using lit. 100+ requests and over a megabyte of Javascript to render a side menu.

Because they probably did the "several runtimes don't matter" thing, and every tiny component loads the full lit runtime




I have no idea about that but if the figures you’re providing are correct it’s pretty obvious the answer is that they did it wrong. There is nothing in the web component API that would require 100+ requests nor several MB of JS, especially when you’re in control of every step in the process!


> every tiny component loads the full lit runtime

This is just not true.


Why does it need 100+ requests and over a megabyte of JS then?

Edit: when it was "unveiled" the sum total of JS was 178 requests totaling 1.37 MB: https://x.com/dmitriid/status/1777404560316707052


I don't know, but it only loads one copy of Lit.


Thank you, good to know




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: