perf(launcher): implement staggered data loading for sessions and presentations
- Optimized session list load to be shell-only, preventing initial request storms.\n- Moved deep data fetching (presenters/files) into the Presentation component level using Svelte effects.\n- Deferred child collection lookups until components are rendered in the DOM.\n- Fixed ae_api import in launcher_presentation_view.\n- Hardened background refresh logic to respect requested views.
This commit is contained in:
@@ -153,9 +153,13 @@ export async function load_ae_obj_li__event_presentation({
|
||||
_refresh_presentation_li_background({ api_cfg, for_obj_type, for_obj_id, inc_file_li, inc_presenter_li, enabled, hidden, view, limit, offset, order_by_li, try_cache, log_lvl: 0 });
|
||||
|
||||
// Warm cache for nested loads in the background (FIRE AND FORGET)
|
||||
// DEPRECATED Optimization: Don't fire child loads for every item in a list here.
|
||||
// Let the specific Presentation component handle its own children to stagger requests.
|
||||
/*
|
||||
cached_li.forEach(p => {
|
||||
_handle_nested_loads(p, { api_cfg, inc_file_li, inc_presenter_li, enabled, hidden, limit, offset, try_cache, log_lvl: 0 });
|
||||
});
|
||||
*/
|
||||
|
||||
return cached_li;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,8 @@ export async function load_ae_obj_li__event_session({
|
||||
// Background refresh (non-blocking)
|
||||
_refresh_session_li_background({
|
||||
api_cfg, for_obj_type, for_obj_id, view,
|
||||
inc_file_li, inc_all_file_li, inc_presentation_li, inc_presenter_li,
|
||||
// Optimization: Disable nested loads for list members to prevent request storms
|
||||
inc_file_li: false, inc_all_file_li: false, inc_presentation_li: false, inc_presenter_li: false,
|
||||
enabled, hidden, limit, offset, order_by_li, try_cache,
|
||||
log_lvl: log_lvl > 1 ? log_lvl : 0
|
||||
});
|
||||
@@ -231,6 +232,14 @@ async function _refresh_session_li_background({ api_cfg, for_obj_type, for_obj_i
|
||||
await db_save_ae_obj_li__ae_obj({ db_instance: db_events, table_name: 'session', obj_li: processed, properties_to_save, log_lvl });
|
||||
if (log_lvl) console.log(`💾 [Trace] _refresh_session_li: Saved to IDB cache.`);
|
||||
}
|
||||
|
||||
// Fire nested loads for each session only if explicitly requested (usually only for single objects)
|
||||
if (inc_file_li || inc_presentation_li) {
|
||||
processed.forEach(s => {
|
||||
_handle_nested_loads(s, { api_cfg, inc_file_li, inc_all_file_li, inc_presentation_li, inc_presenter_li, enabled, hidden, limit, offset, try_cache, log_lvl: 0 });
|
||||
});
|
||||
}
|
||||
|
||||
return processed;
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user