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

Use Svelte 5 runes, snippets, callbacks #214

Merged
merged 50 commits into from
Nov 30, 2024
Merged

Use Svelte 5 runes, snippets, callbacks #214

merged 50 commits into from
Nov 30, 2024

Conversation

dimfeld
Copy link
Owner

@dimfeld dimfeld commented Nov 8, 2024

Breaking Changes

  • Svelte 5 is now required
  • Event handlers are switched to use the new plain function format
  • Events no longer have the map attribute added to them since this is already present as target
  • For anyone implementing their own layer components, the context structure has changed a lot.
  • Update deck.gl dependency to v9.

Other Changes

  • Additional event types supported
  • Event handlers are only added to the map when the event handler is present. This is enabled by Svelte 5's ability to see if something is listening to an event or not.
  • Added feature type generics to a lot of components so you can better express your types
  • Examples now show the entire page source instead of just the most relevant parts.

Tasks

  • Vercel failing on import.meta use in tailwind config, but my local Node fails if I use require.resolve
  • Update events system to work with Svelte 5 callback style
  • Make sure all slots/snippets were converted correctly
  • Look at svelte migrate's uses of run and convert to proper Svelte 5
  • Convert internal popup logic to use runes
  • Update map context objects to use runes instead of stores
  • Change many uses of null to undefined to better work with Svelte props
  • Add feature type generics everywhere for better type safety in snippets
  • Upgrade deck.gl to v9
  • Final testing
  • Tweak code sample blocks as needed

Closes #187
Closes #188

Copy link

changeset-bot bot commented Nov 8, 2024

⚠️ No Changeset found

Latest commit: e0536c8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-maplibre ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 8:06am

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 77 out of 92 changed files in this pull request and generated 1 suggestion.

Files not reviewed (15)
  • package.json: Language not supported
  • src/app.postcss: Language not supported
  • src/lib/AttributionControl.svelte: Language not supported
  • src/lib/CircleLayer.svelte: Language not supported
  • src/lib/Control.svelte: Language not supported
  • src/lib/ControlButton.svelte: Language not supported
  • src/lib/ControlGroup.svelte: Language not supported
  • src/lib/DeckGlLayer.svelte: Language not supported
  • src/lib/DefaultMarker.svelte: Language not supported
  • src/lib/FillExtrusionLayer.svelte: Language not supported
  • .eslintrc.cjs: Evaluated as low risk
  • postcss.config.js: Evaluated as low risk
  • .changeset/nice-waves-bake.md: Evaluated as low risk
  • .changeset/honest-shrimps-tie.md: Evaluated as low risk
  • .changeset/ten-trees-shop.md: Evaluated as low risk
Comments skipped due to low confidence (1)

eslint.config.js:3

  • The import statement for 'eslint-plugin-svelte' is incorrect. It should be 'eslint-plugin-svelte'.
import svelte from 'eslint-plugin-svelte';

eslint.config.js Show resolved Hide resolved
@dimfeld
Copy link
Owner Author

dimfeld commented Nov 15, 2024

Copilot review not too useful on Svelte yet, oh well

This fixes one of the misunderstandings in the package, which was that
map.loaded() works differently from Leaflet.
@0gust1
Copy link

0gust1 commented Nov 21, 2024

Useless comment to express my enthusiasm :)
Many thanks for the lib !

@dimfeld dimfeld merged commit af071ed into master Nov 30, 2024
2 checks passed
@dimfeld dimfeld deleted the next branch November 30, 2024 20:23
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 this pull request may close these issues.

Change some uses of null to undefined Upgrade deck.gl dependency to 9.0
3 participants