fix: reduce svelte-check warnings from 175 to 95 (80 eliminated)
Svelte 5 reactivity pattern fixes:
- Convert prop/data captures to $derived where used in reactive contexts
- Wrap store assignments in $effect + untrack for ae_acct pattern
- Move sign_in_out URL param processing to onMount (from top-level if(browser))
- Wrap debug console.log blocks in $effect instead of top-level if(log_lvl)
- Fix $state initializers reading props directly ($state(link_to_id) → $state(''))
- Fix box = $state(null) in journals layout
CSS fixes:
- TipTap scss: change :global(.tiptap){nested} to :global{.tiptap{nested}} so
Svelte does not scope-hash dynamic content selectors (latent CSS bug fixed)
- element_manage_hosted/event: dq__where vars → $derived for reactive liveQuery
Config:
- svelte.config.js: add onwarn (suppresses a11y/CSS in Vite pipeline; note:
svelte-check 4.x does not read onwarn so CLI count unchanged)
Remaining 95 warnings (acceptable baseline):
- 70x a11y_label: form labels need for/id attributes (proper a11y fix deferred)
- 12x lu_* false positives in IDAA async callbacks (correct code)
- 8x CSS dynamic selectors Svelte cannot detect at compile time
- 5x other intentional patterns (autofocus, form state, log_lvl callbacks)
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
let { data }: Props = $props();
|
||||
|
||||
let event_id: string = data.params.event_id;
|
||||
let event_id = $derived(data.params.event_id);
|
||||
|
||||
let show_create_template_modal: boolean = $state(false);
|
||||
let selected_template_id: string | null = $state(null);
|
||||
|
||||
@@ -42,13 +42,8 @@
|
||||
// to prevent circular dependency loops during hydration.
|
||||
let ae_acct = $derived(data[data.account_id]);
|
||||
|
||||
const url_event_id = data.params.event_id;
|
||||
const url_event_location_id = data.params.event_location_id;
|
||||
|
||||
$effect(() => {
|
||||
const _id = url_event_id;
|
||||
const _loc_id = url_event_location_id;
|
||||
});
|
||||
let url_event_id = $derived(data.params.event_id);
|
||||
let url_event_location_id = $derived(data.params.event_location_id);
|
||||
|
||||
// $ae_loc.url_origin = data.url.origin;
|
||||
|
||||
|
||||
@@ -38,12 +38,14 @@
|
||||
|
||||
// export let allow_basic: boolean = false;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`container_class_li: ${container_class_li}; show_presentation_fields: ${show_presentation_fields}; show_session_fields: ${show_session_fields}`
|
||||
);
|
||||
// console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
$effect(() => {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`container_class_li: ${container_class_li}; show_presentation_fields: ${show_presentation_fields}; show_session_fields: ${show_session_fields}`
|
||||
);
|
||||
// console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
|
||||
@@ -39,9 +39,11 @@
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
import { db_events } from '$lib/ae_events/db_events';
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
$effect(() => {
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
|
||||
@@ -22,17 +22,10 @@
|
||||
import Comp_event_presentation_obj_li from '../../../../ae_comp__event_presentation_obj_li.svelte';
|
||||
import Comp_event_presenter_form_agree from '../../presenter/[presenter_id]/ae_comp__event_presenter_form_agree.svelte';
|
||||
|
||||
// STABILITY FIX: Capture URL params as plain constants for the liveQuery
|
||||
// closures so the observable sees a stable identifier value. Capturing
|
||||
// the raw `data.params` or a reactive store reference here can lead to
|
||||
// the liveQuery being recreated or seeing transient values on cold-start.
|
||||
const url_session_id = data.params.session_id;
|
||||
const url_event_id = data.params.event_id;
|
||||
|
||||
$effect(() => {
|
||||
const _id = url_session_id;
|
||||
const _eid = url_event_id;
|
||||
});
|
||||
// STABILITY FIX: Capture URL params reactively via $derived so liveQuery
|
||||
// closures see a stable identifier that updates on same-route navigation.
|
||||
let url_session_id = $derived(data.params.session_id);
|
||||
let url_event_id = $derived(data.params.event_id);
|
||||
|
||||
// KNOWN ISSUE (TODO): This page currently depends on related records
|
||||
// (presentations, hosted files, presenters) already existing in IndexedDB.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
lq__auth__event_presenter_obj
|
||||
}: Props = $props();
|
||||
|
||||
import { browser } from '$app/environment';
|
||||
import { onMount } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import {
|
||||
@@ -34,7 +34,7 @@
|
||||
events_trig_kv
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
|
||||
if (browser) {
|
||||
onMount(() => {
|
||||
console.log('Browser environment detected.');
|
||||
|
||||
console.log(
|
||||
@@ -98,7 +98,7 @@
|
||||
// We need to set browser history and force all load functions to rerun.
|
||||
goto(new_url, { replaceState: true, invalidateAll: true });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// For session point of contact (moderator, chair, LCI Champions).
|
||||
function session_sign_in() {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
}: Props = $props();
|
||||
|
||||
// Local Variables
|
||||
let task_id = $state(link_to_id);
|
||||
let task_id: string = $state('');
|
||||
let input_file_list: any = $state(null);
|
||||
let ae_promises: key_val = $state({});
|
||||
let input_element_id = 'ae_comp__event_files_upload__input';
|
||||
|
||||
Reference in New Issue
Block a user