Skip to content

Hot reloading takes a lot of time #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SaadBazaz opened this issue Aug 30, 2024 · 3 comments
Open

Hot reloading takes a lot of time #13

SaadBazaz opened this issue Aug 30, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@SaadBazaz
Copy link
Member

When developing using this library, hot reloads take a lot of time.

This occurs not only in the demo in this repo, but also happens in external projects using this library as an installed package.

I have a hunch it's because of Lit, or because of getSlotProp.

@SaadBazaz SaadBazaz added the bug Something isn't working label Aug 30, 2024
@SaadBazaz
Copy link
Member Author

Possible reason?
lit/lit#1844

@SaadBazaz
Copy link
Member Author

SaadBazaz commented Dec 3, 2024

We're using this library in a professional project.

It's done well for us so far, but the biggest problem (out of many) is that hot-reloading in NextJS stops working when we use our library. Also, consequently I think, builds take too long.

We are considering revamping all our project's interface due to this. It's a huge issue.

If someone could fix this for us, that'd be awesome.

Hint:
I feel like it's got something to do with our usage of shadow DOMs. Maybe if we don't use Shadow DOMs, it might bring back this functionality (along with many others).

We've set up a bounty of 17.5 USD (negotiable) if someone from the community takes it up and delivers.

@msaadg
Copy link

msaadg commented Feb 27, 2025

Okay, so I tried reproducing the issue and have noticed two things. The hot reload does not seem to work when I do pnpm dev and the application compiles and starts for the first time. However, when I refresh it once, the hot reload seems to start working but it takes too much time.

When I refresh the following logs are outputted, I feel this might be very relevant:
index:dev: 'CustomElementRegistry' already has "md-badge" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored. index:dev: Make sure to test your application with a production build as repeat registrations will throw in production. index:dev: 'CustomElementRegistry' already has "md-elevation" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored. index:dev: Make sure to test your application with a production build as repeat registrations will throw in production. ......

Multiple versions of Lit are also loaded which might explain why it takes so long to hot reload.

reproduce_hot_reload_comp.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants