Skip to content
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

Speed up dev servers; lucide-svelte issue #575

Closed
shyakadavis opened this issue Dec 30, 2023 · 5 comments · Fixed by #591
Closed

Speed up dev servers; lucide-svelte issue #575

shyakadavis opened this issue Dec 30, 2023 · 5 comments · Fixed by #591
Assignees
Labels
type: enhancement An improvement or enhancement to an existing feature

Comments

@shyakadavis
Copy link
Contributor

Current Behavior

Given lucide-icons/lucide#1707, which you also briefly touched over in the stream, I wanted to volunteer to import all lucide-svelte icons in the new/faster format.

Expected Behavior

import Circle from "lucide-svelte/icons/circle";

Steps To Reproduce

N/A

Link to Reproduction / Stackblitz (reproduction template)

No response

More Information

No response

@shyakadavis shyakadavis added the type: bug A confirmed report of unexpected behavior in the application label Dec 30, 2023
@huntabyte
Copy link
Owner

Go for it!

@AdrianGonz97
Copy link
Collaborator

Thanks for taking this on! 🙂

I just want to note down here (before I forget) that we'll have to validate that changing the import paths to use deep imports doesn't break our registry builder script. There's a good chance that it will, so we'll have to modify it to accommodate. I can handle that part right before we merge your PR.

@huntabyte huntabyte added type: enhancement An improvement or enhancement to an existing feature and removed type: bug A confirmed report of unexpected behavior in the application labels Jan 8, 2024
@coryvirok

This comment has been minimized.

@gregmsanderson
Copy link

gregmsanderson commented Feb 15, 2024

If the docs could be updated, that would be good for new users.

For example I've just been trying it out today. I created a "hello world" app with some basic pages, tried adding a dark mode toggle based on https://www.shadcn-svelte.com/docs/dark-mode and noticed the build took much longer. Sure enough it was looping over every icon as part of the build, despite only needing the sun and moon icon.

Making this change:

//import { Sun, Moon } from 'lucide-svelte';
import SunIcon from 'lucide-svelte/icons/sun';
import MoonIcon from 'lucide-svelte/icons/moon';

... and updating the page to match the names resulted in going from ...

vite v5.1.3 building for production...
✓ 2023 modules transformed.

... to ...

vite v5.1.3 building for production...
✓ 595 modules transformed.

Way faster.

(I could do a PR for that one page but I see there's an existing PR that looks to cover it throughout #591)

@huntabyte
Copy link
Owner

We're tracking @gregmsanderson. There's an issue with a dependency that is holding us back at the moment but should be resolved soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement An improvement or enhancement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants