You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have a question with the newly updated framework integration guide. I'm using Svelte, but this might apply to other frameworks/cases.
What is the purpose for the dynamicimport('flyonui/flyonui'); instead of simply doing a static import 'flyonui/flyonui';?
At least for Svelte, as per guide (https://flyonui.com/framework-integrations/svelte/), the other plugins are imported statically, whereas FlyonUI JS is imported dynamically, returning earlier from the hook, leading to the earliest execution of HSStaticMethods.autoInit() in +layout.svelte resulting in error. After making the import static, there was no error anymore, and I haven't been able to identify any problem. So, what's the point? Any performance benefit?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have a question with the newly updated framework integration guide. I'm using Svelte, but this might apply to other frameworks/cases.
What is the purpose for the dynamic
import('flyonui/flyonui');
instead of simply doing a staticimport 'flyonui/flyonui';
?At least for Svelte, as per guide (https://flyonui.com/framework-integrations/svelte/), the other plugins are imported statically, whereas FlyonUI JS is imported dynamically, returning earlier from the hook, leading to the earliest execution of
HSStaticMethods.autoInit()
in+layout.svelte
resulting in error. After making the import static, there was no error anymore, and I haven't been able to identify any problem. So, what's the point? Any performance benefit?Beta Was this translation helpful? Give feedback.
All reactions