[Bug 42150] New: Allow plugins to register Vue islands via registerIsland()
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Bug ID: 42150 Summary: Allow plugins to register Vue islands via registerIsland() Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: me@paulderscheid.xyz QA Contact: testopia@bugs.koha-community.org The islands module provides Koha's Vue component architecture but does not expose a public API for external registration. This enhancement enables plugins to contribute Vue islands to the staff interface. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #1 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 195721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195721&action=edit Bug 42150: Export registerIsland() for plugin use Add a public API to the islands module so that plugins can register Vue components as custom elements. Plugin JS from the intranet_js hook runs before hydrate() fires, so registrations are picked up during the DOM scan. The function includes a duplicate guard, attempting to register a name that already exists logs a console warning and is a no-op, so plugins cannot overwrite core islands. The WebComponentDynamicImport type is also exported so that TypeScript consumers get type safety. To test: 1. Verify existing islands work unchanged: a. Navigate to Administration and confirm admin-menu renders. b. Navigate to Acquisitions and confirm acquisitions-menu and vendor-menu render. 2. Create a test plugin with an intranet_js hook that outputs a module script calling registerIsland() with a simple inline Vue component served via static_routes. 3. Place the matching custom element tag in a template. 4. Load the page and verify the component renders. 5. Open the browser console and verify no errors. 6. Call registerIsland() with an already-registered name and verify the console warning appears and the original component is unchanged. 7. Remove the custom element tag from the template and verify the component is not loaded unnecessarily. 8. Sign-off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #2 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 195722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195722&action=edit Bug 42150: (follow-up) Validate custom element names Reject names that do not conform to the web component spec (lowercase, must contain a hyphen, must start with a letter). This catches typos early with a clear console warning rather than letting them fail silently or throw at customElements.define(). To test: 1. Call registerIsland("InvalidName", { ... }) and verify a warning is logged and registration is rejected. 2. Call registerIsland("no-problem", { ... }) and verify it succeeds. 3. Call registerIsland("123-bad", { ... }) and verify it is rejected (starts with digit). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #3 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 195723 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195723&action=edit Bug 42150: (follow-up) Re-export h from Vue for plugin use Plugins that register inline islands need Vue's h() function to build render trees without requiring a separate Vue import or the template compiler. Re-exporting h from the islands module lets plugins import everything they need from a single source. To test: 1. From a plugin's intranet_js module script, import h: const { registerIsland, h } = await import(islandsSrc); 2. Use h() in a component's setup/render function. 3. Verify the component renders without the "runtime compilation is not supported" warning. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #4 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 195724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195724&action=edit Bug 42150: (follow-up) Share Vue via import map and handle frozen modules Plugin-provided Vue SFCs need access to the same Vue runtime that Koha uses for defineCustomElement. Without this, plugins bundle their own Vue, creating two reactive systems that do not interoperate (reactivity breaks silently). - Re-export all of Vue from islands.esm.js so it serves as the single source of Vue APIs - Add import map in main-container.inc mapping "vue" to islands.esm.js — plugin builds that externalize Vue now resolve to Koha's shared instance - Clone frozen ES module exports before passing to defineCustomElement (module namespace objects are frozen per spec, but defineCustomElement needs to set properties) To test: 1. Verify existing core islands still render (admin-menu, acquisitions-menu, vendor-menu). 2. Install the test plugin (test-islanddemo-0.1.0.kpz). 3. Navigate to any staff page and verify the Vue Island Demo component renders with styling. 4. Click the counter button repeatedly and verify the count updates reactively. 5. Open browser console — no errors except CSP report-only warnings. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #5 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 195725 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195725&action=edit Bug 42150: (follow-up) Guard against null importFn return If a plugin's importFn returns null or undefined (e.g. the static file was removed or the import fails silently), the frozen module clone would crash with "Cannot convert undefined or null to object". This adds an early return before the clone attempt. To test: 1. Register an island with an importFn that returns undefined. 2. Verify no error is thrown and the island is silently skipped. 3. Other islands on the same page still render normally. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #6 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 195726 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195726&action=edit Bug 42150: (follow-up) Add nonce to import map script tag The QA test tools require all <script> elements to have a src or nonce attribute. Import maps are declarative JSON and not executed as code, but adding the nonce satisfies the check and is harmless. To test: 1. Run qa-test-tools on the patch set and verify all files pass the forbidden_patterns check. 2. Load any staff page and verify the import map still works (Vue islands render, plugin islands have reactivity). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #7 from Paul Derscheid <me@paulderscheid.xyz> --- Created attachment 195727 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195727&action=edit Test plugin for a reactive vue island injected via plugin. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Michael Skarupianski <michael.skarupianski@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.skarupianski@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #8 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- tried to signoff today but patch doesn't apply cleanly : <code> Patch application failed for attachment 195724 - Bug 42150: (follow-up) Share Vue via import map and handle frozen modules Patches left in /tmp/6ggPtpc5nB for manual application if needed To resolve: 1. Fix conflicts (use 'git mergetool' or edit files manually) 2. Stage resolved files with 'git add' 3. Continue with 'git bz apply --continue' or 'git am --continue' 4. Or skip this patch with 'git bz apply --skip' 5. Or abort with 'git bz apply --abort' Error: Apply failed: Git command (git am -3 /tmp/6ggPtpc5nB/0004-195724.patch) failed: error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/js/vue/modules/islands.ts). error: could not build fake ancestor </code> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #9 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Could you refetch main and try again? Somehow that fixed it on my end. Thanks for taking a look. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #10 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Huh, weird. Now I run into the same issue as well again (on a second apply attempt). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #11 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Hi, I could apply yesterday evening, I'll test this out this morning and hopefully signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195727|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #12 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196078 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196078&action=edit Test plugin for a reactive vue island injected via plugin. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #13 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196079 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196079&action=edit importFn returns undefined, island silently skipped, no crash, sibling island still renders. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #14 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196080 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196080&action=edit Tries 4 invalid names (InvalidName, nohyphen, 123-bad, -bad-start), all rejected with warnings. One valid name succeeds. Renders a summary of results. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #15 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196081 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196081&action=edit Registers test-dup-island twice, second is rejected. Also tries to overwrite core admin-menu, rejected. Original component renders unchanged. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #16 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196082 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196082&action=edit Imports h and ref from islands.esm.js (no separate Vue import). Builds a component with a reactive counter entirely via render function. Logs PASS/FAIL for each export. Each plugin uses the intranet_js hook, injects its test island into the page, and calls hydrate(). Console output confirms pass/fail for each test case. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196079|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #17 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196104 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196104&action=edit importFn returns undefined, island silently skipped, no crash, sibling island still renders. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196080|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #18 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196105&action=edit Tries 4 invalid names (InvalidName, nohyphen, 123-bad, -bad-start), all rejected with warnings. One valid name succeeds. Renders a summary of results. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195721|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195722|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195723|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195724|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195725|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195726|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #19 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196140 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196140&action=edit Bug 42150: Export registerIsland() for plugin use Add a public API to the islands module so that plugins can register Vue components as custom elements. Plugin JS from the intranet_js hook runs before hydrate() fires, so registrations are picked up during the DOM scan. The function includes a duplicate guard, attempting to register a name that already exists logs a console warning and is a no-op, so plugins cannot overwrite core islands. The WebComponentDynamicImport type is also exported so that TypeScript consumers get type safety. To test: 1. Verify existing islands work unchanged: a. Navigate to Administration and confirm admin-menu renders. b. Navigate to Acquisitions and confirm acquisitions-menu and vendor-menu render. 2. Create a test plugin with an intranet_js hook that outputs a module script calling registerIsland() with a simple inline Vue component served via static_routes. 3. Place the matching custom element tag in a template. 4. Load the page and verify the component renders. 5. Open the browser console and verify no errors. 6. Call registerIsland() with an already-registered name and verify the console warning appears and the original component is unchanged. 7. Remove the custom element tag from the template and verify the component is not loaded unnecessarily. 8. Sign-off Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #20 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196141 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196141&action=edit Bug 42150: (follow-up) Validate custom element names Reject names that do not conform to the web component spec (lowercase, must contain a hyphen, must start with a letter). This catches typos early with a clear console warning rather than letting them fail silently or throw at customElements.define(). To test: 1. Call registerIsland("InvalidName", { ... }) and verify a warning is logged and registration is rejected. 2. Call registerIsland("no-problem", { ... }) and verify it succeeds. 3. Call registerIsland("123-bad", { ... }) and verify it is rejected (starts with digit). Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #21 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196142 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196142&action=edit Bug 42150: (follow-up) Re-export h from Vue for plugin use Plugins that register inline islands need Vue's h() function to build render trees without requiring a separate Vue import or the template compiler. Re-exporting h from the islands module lets plugins import everything they need from a single source. To test: 1. From a plugin's intranet_js module script, import h: const { registerIsland, h } = await import(islandsSrc); 2. Use h() in a component's setup/render function. 3. Verify the component renders without the "runtime compilation is not supported" warning. Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #22 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196143 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196143&action=edit Bug 42150: (follow-up) Share Vue via import map and handle frozen modules Plugin-provided Vue SFCs need access to the same Vue runtime that Koha uses for defineCustomElement. Without this, plugins bundle their own Vue, creating two reactive systems that do not interoperate (reactivity breaks silently). - Re-export all of Vue from islands.esm.js so it serves as the single source of Vue APIs - Add import map in main-container.inc mapping "vue" to islands.esm.js — plugin builds that externalize Vue now resolve to Koha's shared instance - Clone frozen ES module exports before passing to defineCustomElement (module namespace objects are frozen per spec, but defineCustomElement needs to set properties) To test: 1. Verify existing core islands still render (admin-menu, acquisitions-menu, vendor-menu). 2. Install the test plugin (test-islanddemo-0.1.0.kpz). 3. Navigate to any staff page and verify the Vue Island Demo component renders with styling. 4. Click the counter button repeatedly and verify the count updates reactively. 5. Open browser console — no errors except CSP report-only warnings. Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #23 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196144 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196144&action=edit Bug 42150: (follow-up) Guard against null importFn return If a plugin's importFn returns null or undefined (e.g. the static file was removed or the import fails silently), the frozen module clone would crash with "Cannot convert undefined or null to object". This adds an early return before the clone attempt. To test: 1. Register an island with an importFn that returns undefined. 2. Verify no error is thrown and the island is silently skipped. 3. Other islands on the same page still render normally. Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #24 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196145 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196145&action=edit Bug 42150: (follow-up) Add nonce to import map script tag The QA test tools require all <script> elements to have a src or nonce attribute. Import maps are declarative JSON and not executed as code, but adding the nonce satisfies the check and is harmless. To test: 1. Run qa-test-tools on the patch set and verify all files pass the forbidden_patterns check. 2. Load any staff page and verify the import map still works (Vue islands render, plugin islands have reactivity). Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #25 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196146 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196146&action=edit Screenshot with all plugins installed Tried with all plugins installed, not breaking existing vue islands and properly showing error messages. Signed-off, thx Paul! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Michael Skarupianski <michael.skarupianski@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew.auld@openfifth.co.uk | |, clemens.tubach@kit.edu, | |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42189 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42189 [Bug 42189] Allow plugins to inject dashboard widgets via a shared Vue widget registry -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jan.kissig@th-wildau.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #26 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 196460 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196460&action=edit Bug 42150: (follow-up) Remove duplicate h export - The explicit `export { h }` from the "Re-export h" follow-up conflicts with `export * from "vue"` added in the "Share Vue via import map" follow-up, since the wildcard re-export already includes h - Remove the redundant named export to fix the rspack build error: "Duplicate export of 'h'" -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196460|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #27 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 196656 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196656&action=edit Bug 42150: (follow-up) Remove duplicate h export - The explicit `export { h }` from the "Re-export h" follow-up conflicts with `export * from "vue"` added in the "Share Vue via import map" follow-up, since the wildcard re-export already includes h - Remove the redundant named export to fix the rspack build error: "Duplicate export of 'h'" Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |domm@plix.at |y.org | CC| |domm@plix.at -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #28 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Test plan addendum: please run `yarn js:build` after applying the patches to get the updated bundle for islands.ts -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #29 from Thomas Klausner <domm@plix.at> --- Nearly everything worked. But when enabling the plugin `IslandHExport` and navigating to any staff page I get this error in the JS console: Uncaught ReferenceError: hydrate is not defined <anonymous> http://kohadev-intra.koha.loc:8081/cgi-bin/koha/circ/circulation-home.pl:162... or Uncaught ReferenceError: hydrate is not defined <anonymous> http://kohadev-intra.koha.loc:8081/cgi-bin/koha/virtualshelves/shelves.pl:19... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196082|0 |1 is obsolete| | --- Comment #30 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197969&action=edit Imports h and ref from islands.esm.js (no separate Vue import). Builds a component with a reactive counter entirely via render function. Logs PASS/FAIL for each export. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #31 from Thomas Klausner <domm@plix.at> --- With the updated test plugin everything works! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #32 from Thomas Klausner <domm@plix.at> --- I followed the test plan in comment #1, everything worked (after fixing one of the test plugins..). Very nice feature! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196140|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196141|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196142|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196143|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196144|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196145|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196656|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #33 from Thomas Klausner <domm@plix.at> --- Created attachment 197970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197970&action=edit Bug 42150: Export registerIsland() for plugin use Add a public API to the islands module so that plugins can register Vue components as custom elements. Plugin JS from the intranet_js hook runs before hydrate() fires, so registrations are picked up during the DOM scan. The function includes a duplicate guard, attempting to register a name that already exists logs a console warning and is a no-op, so plugins cannot overwrite core islands. The WebComponentDynamicImport type is also exported so that TypeScript consumers get type safety. To test: 1. Verify existing islands work unchanged: a. Navigate to Administration and confirm admin-menu renders. b. Navigate to Acquisitions and confirm acquisitions-menu and vendor-menu render. 2. Create a test plugin with an intranet_js hook that outputs a module script calling registerIsland() with a simple inline Vue component served via static_routes. 3. Place the matching custom element tag in a template. 4. Load the page and verify the component renders. 5. Open the browser console and verify no errors. 6. Call registerIsland() with an already-registered name and verify the console warning appears and the original component is unchanged. 7. Remove the custom element tag from the template and verify the component is not loaded unnecessarily. 8. Sign-off Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #34 from Thomas Klausner <domm@plix.at> --- Created attachment 197971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197971&action=edit Bug 42150: (follow-up) Validate custom element names Reject names that do not conform to the web component spec (lowercase, must contain a hyphen, must start with a letter). This catches typos early with a clear console warning rather than letting them fail silently or throw at customElements.define(). To test: 1. Call registerIsland("InvalidName", { ... }) and verify a warning is logged and registration is rejected. 2. Call registerIsland("no-problem", { ... }) and verify it succeeds. 3. Call registerIsland("123-bad", { ... }) and verify it is rejected (starts with digit). Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #35 from Thomas Klausner <domm@plix.at> --- Created attachment 197972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197972&action=edit Bug 42150: (follow-up) Re-export h from Vue for plugin use Plugins that register inline islands need Vue's h() function to build render trees without requiring a separate Vue import or the template compiler. Re-exporting h from the islands module lets plugins import everything they need from a single source. To test: 1. From a plugin's intranet_js module script, import h: const { registerIsland, h } = await import(islandsSrc); 2. Use h() in a component's setup/render function. 3. Verify the component renders without the "runtime compilation is not supported" warning. Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #36 from Thomas Klausner <domm@plix.at> --- Created attachment 197973 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197973&action=edit Bug 42150: (follow-up) Share Vue via import map and handle frozen modules Plugin-provided Vue SFCs need access to the same Vue runtime that Koha uses for defineCustomElement. Without this, plugins bundle their own Vue, creating two reactive systems that do not interoperate (reactivity breaks silently). - Re-export all of Vue from islands.esm.js so it serves as the single source of Vue APIs - Add import map in main-container.inc mapping "vue" to islands.esm.js — plugin builds that externalize Vue now resolve to Koha's shared instance - Clone frozen ES module exports before passing to defineCustomElement (module namespace objects are frozen per spec, but defineCustomElement needs to set properties) To test: 1. Verify existing core islands still render (admin-menu, acquisitions-menu, vendor-menu). 2. Install the test plugin (test-islanddemo-0.1.0.kpz). 3. Navigate to any staff page and verify the Vue Island Demo component renders with styling. 4. Click the counter button repeatedly and verify the count updates reactively. 5. Open browser console — no errors except CSP report-only warnings. Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #37 from Thomas Klausner <domm@plix.at> --- Created attachment 197974 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197974&action=edit Bug 42150: (follow-up) Guard against null importFn return If a plugin's importFn returns null or undefined (e.g. the static file was removed or the import fails silently), the frozen module clone would crash with "Cannot convert undefined or null to object". This adds an early return before the clone attempt. To test: 1. Register an island with an importFn that returns undefined. 2. Verify no error is thrown and the island is silently skipped. 3. Other islands on the same page still render normally. Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #38 from Thomas Klausner <domm@plix.at> --- Created attachment 197975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197975&action=edit Bug 42150: (follow-up) Add nonce to import map script tag The QA test tools require all <script> elements to have a src or nonce attribute. Import maps are declarative JSON and not executed as code, but adding the nonce satisfies the check and is harmless. To test: 1. Run qa-test-tools on the patch set and verify all files pass the forbidden_patterns check. 2. Load any staff page and verify the import map still works (Vue islands render, plugin islands have reactivity). Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #39 from Thomas Klausner <domm@plix.at> --- Created attachment 197976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197976&action=edit Bug 42150: (follow-up) Remove duplicate h export - The explicit `export { h }` from the "Re-export h" follow-up conflicts with `export * from "vue"` added in the "Share Vue via import map" follow-up, since the wildcard re-export already includes h - Remove the redundant named export to fix the rspack build error: "Duplicate export of 'h'" Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |The islands module provides release notes| |Koha's Vue component | |architecture but does not | |expose a public API for | |external registration. This | |enhancement enables plugins | |to contribute Vue islands | |to the staff interface. | |It also lays the groundwork | |for bug 42189 which allows | |plugins to create new | |dashboard widgets. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 --- Comment #40 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=40788 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #41 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- This will not be backported to 25.11.x due to it being deemed an enhancement or a dependancy not being met -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42150 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED CC| |david@davidnind.com --- Comment #42 from David Nind <david@davidnind.com> --- Plugin related, no changes requried to the manual. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org