Bugzilla – Attachment 171439 Details for
Bug 37911
Prototype vue islands within static pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37911: (follow-up) Experimental introduction of dynamic imports for code splitting
Bug-37911-follow-up-Experimental-introduction-of-d.patch (text/plain), 1.67 KB, created by
Paul Derscheid
on 2024-09-13 08:41:19 UTC
(
hide
)
Description:
Bug 37911: (follow-up) Experimental introduction of dynamic imports for code splitting
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-09-13 08:41:19 UTC
Size:
1.67 KB
patch
obsolete
>From 68d266711a82b1b702adfb37d472f76c64013f04 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Fri, 13 Sep 2024 10:39:00 +0200 >Subject: [PATCH] Bug 37911: (follow-up) Experimental introduction of dynamic > imports for code splitting > >--- > .../prog/js/vue/modules/islands.ts | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts >index db8dcb5d92..862a19df4b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts >@@ -1,17 +1,25 @@ > import { Component, defineCustomElement } from "vue"; >-import HelloIslands from "../components/HelloIslands.vue"; > > /** > * A registry for Vue components. >- * @type {Map<string, string>} >+ * @type {Map<string, () => Promise<Component>>} > */ > export const componentRegistry: Map<string, () => Promise<Component>> = new Map( >- [["hello-islands", HelloIslands]] >+ [ >+ [ >+ "hello-islands", >+ async () => { >+ const module = await import("../components/HelloIslands.vue"); >+ return module.default; >+ }, >+ ], >+ ] > ); > > // Register and define custom elements >-window.requestIdleCallback(() => { >- componentRegistry.forEach((component, name) => { >+window.requestIdleCallback(async () => { >+ componentRegistry.forEach(async (importFn, name) => { >+ const component = await importFn(); > customElements.define( > name, > defineCustomElement(component as any, { shadowRoot: false }) >-- >2.46.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37911
:
171425
|
171426
|
171432
|
171439
|
171440
|
171445
|
171459
|
171517
|
171538
|
171608
|
171685
|
172962
|
172963
|
172965
|
172966
|
172967
|
172968
|
172969
|
172970
|
172971
|
172972
|
172973
|
172974
|
172975