This is an automated email from the ASF dual-hosted git repository.

OyvindLGjesdal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new c9b6b495f4 Fuseki UI: separate source maps, import only the Bootstrap 
parts in use
c9b6b495f4 is described below

commit c9b6b495f4bd8060e23b0431ca023243658050e1
Author: Øyvind Gjesdal <[email protected]>
AuthorDate: Tue Sep 22 22:46:13 2026 +0200

    Fuseki UI: separate source maps, import only the Bootstrap parts in use
    
    * Move source maps out of the bundles (sourcemap 'inline' -> true);
      browsers only fetch the .map files when devtools is open
    * Only import the Bootstrap components in use (collapse in main,
      popover in the dataset info and manage views)
    * Remove Bootstrap's prebuilt CSS, which was included twice
    * Remove data-bs-* attributes that no Bootstrap plugin handles
    * Add an e2e test for opening and closing the collapsed navbar menu
    * Increase chunkSizeWarningLimit for the geo module
      (target/webapp/static/geo-BWNODv4T.js 154.80 kB, if split to its own)
---
 .../jena-fuseki-ui/src/components/ServerStatus.vue |  2 +-
 .../jena-fuseki-ui/src/components/Toast.vue        |  1 -
 jena-fuseki2/jena-fuseki-ui/src/main.js            |  2 +-
 jena-fuseki2/jena-fuseki-ui/src/styles/index.scss  |  1 -
 .../jena-fuseki-ui/src/views/dataset/Info.vue      |  2 +-
 .../src/views/manage/ExistingDatasets.vue          |  2 +-
 .../jena-fuseki-ui/tests/e2e/specs/menu.cy.js      | 66 ++++++++++++++++++++++
 jena-fuseki2/jena-fuseki-ui/vite.config.js         |  6 +-
 8 files changed, 73 insertions(+), 9 deletions(-)

diff --git a/jena-fuseki2/jena-fuseki-ui/src/components/ServerStatus.vue 
b/jena-fuseki2/jena-fuseki-ui/src/components/ServerStatus.vue
index 990b34bf6b..25b9021f58 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/components/ServerStatus.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/components/ServerStatus.vue
@@ -18,7 +18,7 @@
 <template>
   <div>
     <span>server status</span>
-    <a class="d-inline-block" href="#" data-bs-toggle="tooltip" 
:title="serverStatusText">
+    <a class="d-inline-block" href="#" :title="serverStatusText">
       <svg id="status-icon" class="ms-2">
         <circle cx="1em" cy="1em" r="1em" stroke="transparent" 
stroke-width="0" fill="transparent" :class="isUp" />
       </svg>
diff --git a/jena-fuseki2/jena-fuseki-ui/src/components/Toast.vue 
b/jena-fuseki2/jena-fuseki-ui/src/components/Toast.vue
index 10f2d050b3..c4500a6b2d 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/components/Toast.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/components/Toast.vue
@@ -46,7 +46,6 @@
               @click="removeMessage(message.id)"
               type="button"
               class="me-2 mb-1 btn-close btn-close-white"
-              data-bs-dismiss="toast"
               aria-label="Close"
             >
             </button>
diff --git a/jena-fuseki2/jena-fuseki-ui/src/main.js 
b/jena-fuseki2/jena-fuseki-ui/src/main.js
index 8c39356206..87c9acdecf 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/main.js
+++ b/jena-fuseki2/jena-fuseki-ui/src/main.js
@@ -18,7 +18,7 @@
 import { createApp } from 'vue'
 import App from './App.vue'
 import router from './router'
-import 'bootstrap/dist/js/bootstrap.bundle.min'
+import 'bootstrap/js/dist/collapse'
 import { FusekiServicePlugin, ToastPlugin } from '@/plugins/index'
 
 const app = createApp(App)
diff --git a/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss 
b/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss
index babe5f3aa8..d324003bf9 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss
+++ b/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-@import '/node_modules/bootstrap/dist/css/bootstrap.min';
 @import '/node_modules/bootstrap/scss/bootstrap.scss';
 @import 'upload.scss';
 
diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue 
b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue
index 4e43adba91..05bfcc4443 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue
@@ -167,7 +167,7 @@ import Menu from '@/components/dataset/Menu.vue'
 import { displayError } from '@/utils'
 import currentDatasetMixin from '@/mixins/current-dataset'
 import currentDatasetMixinNavigationGuards from 
'@/mixins/current-dataset-navigation-guards'
-import { Popover } from 'bootstrap'
+import Popover from 'bootstrap/js/dist/popover'
 import JenaTable from '@/components/dataset/JenaTable.vue'
 import TableListing from "@/components/dataset/TableListing.vue";
 
diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue 
b/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue
index 0ea6b3240d..e43263650a 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue
@@ -159,7 +159,7 @@ import TableListing from 
'@/components/dataset/TableListing.vue'
 import { library } from '@fortawesome/fontawesome-svg-core'
 import { faTimesCircle, faDownload, faTachometerAlt } from 
'@fortawesome/free-solid-svg-icons'
 import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
-import { Popover } from 'bootstrap'
+import Popover from 'bootstrap/js/dist/popover'
 import { displayNotification } from '@/utils'
 
 library.add(faTimesCircle, faDownload, faTachometerAlt)
diff --git a/jena-fuseki2/jena-fuseki-ui/tests/e2e/specs/menu.cy.js 
b/jena-fuseki2/jena-fuseki-ui/tests/e2e/specs/menu.cy.js
new file mode 100644
index 0000000000..42af850c3d
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-ui/tests/e2e/specs/menu.cy.js
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Tests the navigation menu.
+ *
+ * The menu uses Bootstrap's collapse plugin, which is the only Bootstrap
+ * plugin loaded in main.js. Other specs run at 1440x1024, where the menu
+ * is expanded and the toggler is hidden, so they never exercise it.
+ *
+ * The test starts on the manage page because its view loads Bootstrap's
+ * popover. Importing `{ Popover } from 'bootstrap'` there while main.js
+ * imports the Bootstrap bundle loads two copies of Bootstrap; both handle
+ * the toggler click, and the menu reopens as soon as it closes.
+ */
+describe('menu', () => {
+  describe('on a small screen', () => {
+    beforeEach(() => {
+      // Below Bootstrap's md breakpoint (768px), so navbar-expand-md 
collapses the menu.
+      cy.viewport(375, 667)
+    })
+    it('Opens and closes the collapsed menu with the toggler', () => {
+      cy.visit('/#/manage')
+      cy
+        .contains('h2', 'Manage datasets')
+        .should('be.visible')
+      cy
+        .get('#navbarNav')
+        .should('not.be.visible')
+      cy
+        .get('.navbar-toggler')
+        .should('be.visible')
+        .and('have.attr', 'aria-expanded', 'false')
+        .click()
+      cy
+        .get('#navbarNav')
+        .should('have.class', 'show')
+        .contains('manage')
+        .should('be.visible')
+      cy
+        .get('.navbar-toggler')
+        .should('have.attr', 'aria-expanded', 'true')
+        .click()
+      cy
+        .get('#navbarNav')
+        .should('not.be.visible')
+      cy
+        .get('.navbar-toggler')
+        .should('have.attr', 'aria-expanded', 'false')
+    })
+  })
+})
diff --git a/jena-fuseki2/jena-fuseki-ui/vite.config.js 
b/jena-fuseki2/jena-fuseki-ui/vite.config.js
index b89772e7f0..99c1ad2adb 100644
--- a/jena-fuseki2/jena-fuseki-ui/vite.config.js
+++ b/jena-fuseki2/jena-fuseki-ui/vite.config.js
@@ -56,12 +56,12 @@ export default defineConfig({
     },
   },
   build: {
-    // Our largest chunk: target/webapp/static/Query-CakHSd_3.js  1,172.48 kB 
│ gzip: 350.95 kB
-    chunkSizeWarningLimit: 1250,
+    // Our largest chunk: target/webapp/static/Query-*.js ~1,333 kB │ gzip: 
~388 kB │ map: ~3,607 kB (only fetched when devtools are open)
+    chunkSizeWarningLimit: 1350,
     // Change build paths to make them Maven compatible.
     outDir: 'target/webapp',
     assetsDir: 'static',
-    sourcemap: 'inline'
+    sourcemap: true
   },
   test: {
     globals: true,

Reply via email to