-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Svelte 5 support #235
Comments
Thanks for the tip. Svelte 5 support will definitely come in the future. |
This is not only place with svelte/internal there is like 100 more places unfortunately |
Svelte maintainer here. I'm interested in why you had to reach into |
Author of Event Calendar here 😃. @dummdidumm Thanks for the intervention. I would like to inform you that at the moment the migration to Svelte 5 has not yet been carried out. The reason for using |
Hello @vkurko, do you have a date in mind for svelte 5 support or not yet ? Thanks |
Not yet, unfortunately. Any help in this matter, including sponsorship, is welcome. |
I love this project hoping for svelte 5 support! |
I have made an attempt at fixing this. I have vendorized the svelte/internal methods that are used and shouldn't be used now. However, in this attempt, I have dropped support for the {#if notDestroyed}
<Calendar />
{/if} This would call all the built in constructors/destructors and not cause the potential void/null object situation destroying the element manually would. AFAIK, we cannot implement the solution mentioned by @geoextra would not allow to call the destruct method from within the component, but rather from an external class. |
Thank you for your contribution! I will review and accept your PR later. |
This method is required when using the library outside of Svelte. The simplest example is using the Event Calendar inside a Vue.js component, where when the Vue component is destroyed, the calendar should be destroyed too.
Well, this is not exactly the equivalent of the current solution. It involves another wrapper component that will hide from the outside world all the methods of the Calendar component that it exposes. I'm still looking for a solution. |
If this should be usable standalone, I suggest to create a import { mount, unmount } from 'svelte';
import Calendar from './Calendar.svelte';
export function create(target, props) {
const instance = mount(Calendar, { target, props });
return {
instance,
destroy: () => unmount(instance)
}
} |
v3.6.0 is now available with fixes from @rgon. The |
Sorry, in v3.6.0 the destroy is only available in pre-built version. The ES version will be fixed in the future release. |
Done in v3.6.1. |
When using the
Calendar
component in a Svelte 5 project it relies onget_current_component()
fromsvelte/internal
which has been removed.calendar/packages/core/src/Calendar.svelte
Line 4 in d337436
A possible solution is presented here with an example.
Tested with Svelte
5.0.0-next.50
.The text was updated successfully, but these errors were encountered: