feat: complete Svelte 5 migration across entire application
All checks were successful
CI / update (push) Successful in 2m8s
All checks were successful
CI / update (push) Successful in 2m8s
Migrated all components and routes from Svelte 4 to Svelte 5 syntax:
- Converted export let → $props() with generic type syntax
- Replaced createEventDispatcher → callback props
- Migrated $: reactive statements → $derived() and $effect()
- Updated two-way bindings with $bindable()
- Fixed TypeScript syntax: added lang="ts" to script tags
- Converted inline type annotations to generic parameter syntax
- Updated deprecated event directives to Svelte 5 syntax:
- on:click → onclick
- on:submit → onsubmit
- on:change → onchange
- Converted deprecated <slot> elements → {@render children()}
- Updated slot props to Snippet types
- Fixed season/icon selector components with {#snippet} blocks
- Fixed non-reactive state by converting let → $state()
- Fixed infinite loop in EnhancedBalance by converting $effect → $derived
- Fixed Chart.js integration by converting $state proxies to plain arrays
- Updated cospend dashboard and payment pages with proper reactivity
- Migrated 20+ route files from export let data → $props()
- Fixed TypeScript type annotations in page components
- Updated reactive statements in error and cospend routes
- Removed invalid onchange attribute from Toggle component
- Fixed modal ID isolation in CreateIngredientList/CreateStepList
- Fixed dark mode button visibility in TranslationApproval
- Build now succeeds with zero deprecation warnings
All functionality tested and working. No breaking changes to user experience.
This commit is contained in:
@@ -5,21 +5,22 @@
|
||||
import { PREDEFINED_USERS, isPredefinedUsersMode } from '$lib/config/users';
|
||||
|
||||
|
||||
import { formatCurrency } from '$lib/utils/formatters'; export let data;
|
||||
export let form;
|
||||
import { formatCurrency } from '$lib/utils/formatters';
|
||||
|
||||
let { data, form } = $props();
|
||||
|
||||
// Use server-side data with progressive enhancement
|
||||
let debtData = data.debtData || {
|
||||
let debtData = $state(data.debtData || {
|
||||
whoOwesMe: [],
|
||||
whoIOwe: [],
|
||||
totalOwedToMe: 0,
|
||||
totalIOwe: 0
|
||||
};
|
||||
let loading = false; // Start as false since we have server data
|
||||
let error = data.error || form?.error || null;
|
||||
let selectedSettlement = null;
|
||||
let settlementAmount = form?.values?.amount || '';
|
||||
let submitting = false;
|
||||
});
|
||||
let loading = $state(false); // Start as false since we have server data
|
||||
let error = $state(data.error || form?.error || null);
|
||||
let selectedSettlement = $state(null);
|
||||
let settlementAmount = $state(form?.values?.amount || '');
|
||||
let submitting = $state(false);
|
||||
let predefinedMode = isPredefinedUsersMode();
|
||||
|
||||
onMount(() => {
|
||||
|
||||
Reference in New Issue
Block a user