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

Update lucide-svelte for compatibility with Svelte 5 runes mode #2727

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aurelienrichard
Copy link

@aurelienrichard aurelienrichard commented Jan 11, 2025

closes #2312
closes #2565
closes #2716

What is the purpose of this pull request?

  • New Icon
  • Bug fix
  • New Feature
  • Documentation update
  • Other:

Description

Adds Svelte 5 runes mode compatibility to lucide-svelte package.


This involved updating the following dependencies:
@sveltejs/vite-plugin-svelte,
@testing-library/svelte,
svelte,
vite

pnpm-lock.yaml is updated to reflect the above.


The following files have been updated with the new Svelte 5 runes syntax and types:
Icon.svelte
exportTemplate.mjs
types.ts
This includes support for the new built-in class syntax.


The test snapshots had to be updated for the tests to pass. This is because the HTML generated by Svelte 5 is slightly different from that generated by Svelte 4.


vitest.config.ts:
Updated to reflect the version bump of the svelte plugin (hot: false is now deprecated).
Running the tests was throwing an error about onMount being called on the server. Following these steps from the testing library docs fixed it.
There is a type error that I couldn't seem to solve so it's under @ts-expect-error for now.

Before Submitting

* Update peerDependencies to support Svelte 5

* Bump svelte version

* Bump @testing-library/svelte version

* Remove alias in vitest.config.ts that causes tests to fail due to deprecated svelte/internal API

* Convert to svelte 5 syntax

* Bump vite & @sveltejs/vite-plugin-svelte version

* Fix error during render when children prop is missing & fix components being mounted on the server during tests

* Update test snapshots to reflect the differences in the html generated by svelte 5

* Convert class attribute to new array syntax with built-in clsx

* Convert export template to svelte 5 syntax
@github-actions github-actions bot added 📦 dependencies Pull requests that update a dependency file 🧣 svelte package About the Svelte package labels Jan 11, 2025
@aurelienrichard aurelienrichard changed the title Update lucide-svelte to Svelte 5 Update lucide-svelte package for Svelte 5 runes mode compatibility Jan 11, 2025
@aurelienrichard aurelienrichard changed the title Update lucide-svelte package for Svelte 5 runes mode compatibility Update lucide-svelte for compatibility with Svelte 5 runes mode Jan 11, 2025
@OllieJT
Copy link

OllieJT commented Jan 13, 2025

Nice work @aurelienrichard! I'm not a maintainer but just gave the diff a look over looks like you caught everything.

Hopefully this gets a merge soon.

@Jumaron
Copy link

Jumaron commented Jan 20, 2025

@karsa-mistmere Sorry for the Ping, but this would be so important for me and many others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 dependencies Pull requests that update a dependency file 🧣 svelte package About the Svelte package
Projects
None yet
3 participants