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: address Svelte 5 warnings #2011

Merged
merged 3 commits into from
Oct 24, 2024
Merged

fix: address Svelte 5 warnings #2011

merged 3 commits into from
Oct 24, 2024

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Oct 20, 2024

Fixes #2016.

When using this library with Svelte 5, I'm seeing development warnings in the console.

11:18:07 [vite] ✨ new dependencies optimized: svelte/internal/client
11:18:07 [vite] ✨ optimized dependencies changed. reloading
11:18:07 AM [vite-plugin-svelte] node_modules/carbon-components-svelte/src/Breakpoint/Breakpoint.svelte:43:48 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
11:18:08 AM [vite-plugin-svelte] node_modules/carbon-components-svelte/src/OverflowMenu/OverflowMenu.svelte:195:2 The value of 'aria-haspopup' must be exactly one of "false", "true", "menu", "listbox", "tree", "grid" or "dialog"
11:18:08 AM [vite-plugin-svelte] node_modules/carbon-components-svelte/src/TextInput/TextInput.svelte:97:24 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update
11:18:08 AM [vite-plugin-svelte] node_modules/carbon-components-svelte/src/TextInput/PasswordInput.svelte:91:24 Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update

This isn't a blocker, but it'd be nice to address these, especially if it's a backwards-compatible change.

My approach in #2010:

  1. Upgrade tooling to Svelte 5 (including upgrading TypeScript).
  2. Run svelte-check on source code and/or run npm run build:lib to identify warnings emitted by Svelte 5.
  3. Address the warnings until they disappear.
  4. Cherry pick c2644a5 and open this PR.

@metonym
Copy link
Collaborator Author

metonym commented Oct 20, 2024

CC @brunnerh – would value any insight/thoughts you might have here. Short term goal is to avoid development warnings if using Svelte 5.

@metonym metonym changed the title chore: address Svelte 5 warnings fix: address Svelte 5 warnings Oct 20, 2024
Copy link
Contributor

@brunnerh brunnerh left a comment

Choose a reason for hiding this comment

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

The approach seems valid, though all components should also be tested for compatibility. Since the Svelte 5 reactivity system is completely different, there is definitely potential for breakage.

src/TextInput/PasswordInput.svelte Outdated Show resolved Hide resolved
src/TextInput/TextInput.svelte Outdated Show resolved Hide resolved
metonym and others added 2 commits October 23, 2024 20:25
Co-authored-by: brunnerh <brunnerh@users.noreply.github.com>
Co-authored-by: brunnerh <brunnerh@users.noreply.github.com>
@metonym
Copy link
Collaborator Author

metonym commented Oct 24, 2024

Great, thanks for the review. Keeping track of Svelte 5 compatibility issues in #2012.

@metonym metonym merged commit 43fccac into master Oct 24, 2024
3 checks passed
@metonym metonym deleted the address-svelte5-warnings branch October 24, 2024 14:43
@metonym
Copy link
Collaborator Author

metonym commented Oct 25, 2024

Fixed in v0.85.3

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.

[Svelte 5] Development warnings
2 participants