Bugzilla – Attachment 172968 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.75 KB, created by
Matt Blenkinsop
on 2024-10-18 12:07:13 UTC
(
hide
)
Description:
Bug 37911: (follow-up) Experimental introduction of dynamic imports for code splitting
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-10-18 12:07:13 UTC
Size:
1.75 KB
patch
obsolete
>From 6a4efcf3e3eec42bea6307165b54a814db0bc28f 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 > >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >--- > .../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 db8dcb5d928..862a19df4b1 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.39.3 (Apple Git-146)
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