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

Fix for updating to svelte 5 #5

Open
binaryme opened this issue Nov 8, 2024 · 0 comments
Open

Fix for updating to svelte 5 #5

binaryme opened this issue Nov 8, 2024 · 0 comments

Comments

@binaryme
Copy link

binaryme commented Nov 8, 2024

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch fontawesome-svelte@2.0.1 for the project I'm working on. The recent updates in the Svelte framework deprecated the tag option in svelte:options, replacing it with customElement to better align with web standards for defining custom elements. This change was necessary to resolve compilation errors caused by the deprecated usage in the FontAwesome Svelte components. Here's how I adapted the FontAwesome package to be compatible with the latest Svelte API:

diff
Copiar código
diff --git a/node_modules/fontawesome-svelte/src/FontAwesomeIcon.svelte b/node_modules/fontawesome-svelte/src/FontAwesomeIcon.svelte
index 366be9e..4a4be67 100644
--- a/node_modules/fontawesome-svelte/src/FontAwesomeIcon.svelte
+++ b/node_modules/fontawesome-svelte/src/FontAwesomeIcon.svelte
@@ -84,5 +84,5 @@
});
</script>

-<svelte:options tag={null} />
+<svelte:options customElement={null} />
{@html html}
diff --git a/node_modules/fontawesome-svelte/src/FontAwesomeLayers.svelte b/node_modules/fontawesome-svelte/src/FontAwesomeLayers.svelte
index 739296e..7f57758 100644
--- a/node_modules/fontawesome-svelte/src/FontAwesomeLayers.svelte
+++ b/node_modules/fontawesome-svelte/src/FontAwesomeLayers.svelte
@@ -10,7 +10,7 @@
].join(" ");
</script>

-<svelte:options tag={null} />
+<svelte:options customElement={null} />

diff --git a/node_modules/fontawesome-svelte/src/FontAwesomeLayersText.svelte b/node_modules/fontawesome-svelte/src/FontAwesomeLayersText.svelte index 96a2480..a3586c8 100644 --- a/node_modules/fontawesome-svelte/src/FontAwesomeLayersText.svelte +++ b/node_modules/fontawesome-svelte/src/FontAwesomeLayersText.svelte @@ -40,5 +40,5 @@ }); </script>

-<svelte:options tag={null} />
+<svelte:options customElement={null} />
{@html renderedText}
This patch resolves the deprecation warning and ensures that our FontAwesome Svelte components are up-to-date with the latest Svelte framework requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant