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

Test with Svelte 5 #196

Closed
dimfeld opened this issue Aug 19, 2024 · 4 comments · Fixed by #197
Closed

Test with Svelte 5 #196

dimfeld opened this issue Aug 19, 2024 · 4 comments · Fixed by #197

Comments

@dimfeld
Copy link
Owner

dimfeld commented Aug 19, 2024

This task covers testing that svelte-maplibre works with Svelte 5 as is, and any fixes to be made while keeping the project compatible with Svelte 4.

@ivyrze
Copy link

ivyrze commented Aug 23, 2024

When using the library with Svelte 5 and I'm getting a bunch of new warnings:

[vite-plugin-svelte] node_modules/svelte-maplibre/dist/AttributionControl.svelte:11:18 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
 9: $:
10:   if ($map && !control) {
11:     control = new maplibregl.AttributionControl({
                                                   ^
12:       compact,
13:       customAttribution
[vite-plugin-svelte] node_modules/svelte-maplibre/dist/FullscreenControl.svelte:16:18 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
14:       containerEl = container;
15:     }
16:     control = new maplibregl.FullscreenControl({
                                                  ^
17:       container: containerEl
18:     });
[vite-plugin-svelte] node_modules/svelte-maplibre/dist/GeolocateControl.svelte:14:18 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
12: $:
13:   if ($map && !control) {
14:     control = new maplibregl.GeolocateControl({
                                                 ^
15:       positionOptions,
16:       fitBoundsOptions,

...and so forth for the rest of the controls. Turning on runes mode breaks the build altogether, of course, because the package is still using the Svelte 4 syntax.

@benmccann
Copy link
Contributor

I've sent a PR to Svelte to remove that warning: sveltejs/svelte#14111

What do you think about upgrading this project to use runes and requiring Svelte 5?

@dimfeld
Copy link
Owner Author

dimfeld commented Nov 2, 2024 via email

@joleeee
Copy link

joleeee commented Nov 6, 2024

I'm having trouble even just doing

    <MapLibre
        bind:map

on svelte 5. map stays undefined until after onMount is ran

(not even in runes mode)

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

Successfully merging a pull request may close this issue.

4 participants