https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36674
Jonathan Druart <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186551|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <[email protected]> --- Created attachment 186616 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186616&action=edit Bug 36674: Lazy-load intranet API clients via proxy Replaced the eager imports in the intranet APIClient aggregator with lazy proxies so individual client modules are only fetched the first time they are actually used. Documented the pattern in the createClientProxy JSDoc, and kept the legacy synchronous API intact by forwarding property access, method calls, and promise chaining. The Vue aggregator remains on static imports for now because the rspack bundles already would handle chunking (which we need to configure) and would require broader consumer changes. This is a bit hacky, but only touches the api-client itself, which I like. Otherwise we would have to adjust all consumers. Test plan: 1. Log in to the staff interface and visit Admin → System preferences. 2. Open DevTools, Network tab, and enable “Disable cache”. 3. Trigger an API call (e.g. edit a preference and click “Save”, or run await APIClient.sysprefs.sysprefs.update_all({}).catch(()=>{}); from the console). 4. Confirm a new request for js/fetch/system-preferences-api-client.js appears and the page still behaves as before. 5. Theoretically we would need to test all call sites.. 6. Sign-off Signed-off-by: Jonathan Druart <[email protected]> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
