Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Add output.clean: true to the Cypress plugin rspack build config.
Before Bug 36674 (Nov 2025), this build emitted .map files into
t/cypress/plugins/dist/. After devtool: false was added, the map files
were no longer generated but stale ones persisted on developer machines
(dist/ is gitignored).
When the rspack update in Bug 41587 rebuilt api-client.cjs.js with
dynamic chunk loading, Cypress's webpack created a context module for
the require() expression and matched the stale .map files (webpack's
context regex matches substrings, so *.js.map matches *.js). Webpack
then failed trying to parse JSON sourcemaps as JavaScript.
output.clean: true ensures the dist directory is wiped on every build,
so stale files from previous configurations can never accumulate.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
By setting __webpack_nonce__ webpack/rspack will add the nonce to styles
added using style-loader plugin.
Also, stop fontawesome from auto injecting CSS elements, and instead
manually import them so that they can be picked up by style-loader
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
- Use devtool: false to prevent emitting source maps for cypress.
- Add package script to clean built assets, artifacts.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
We had this following warning in the console:
[Vue warn]: setup() return property "$__" should not start with "$" or "_" which are reserved prefixes for Vue internals.
Trying to fix this and realized we could do better in our handling of
the i18n functions.
This patch suggests to:
1. Have "@k" available as the Koha Vue root path so that we can easily
import without relative paths
TODO - Should be applied to all other imports
2. Import the i18n functions from the components when we need it
3. Do not have them available in the i18n object exported by the
base resource
4. Remove direct use of __() from scripts and always use $__()
(cherry picked from commit 247675939ef28a90d21be863c6a57382cf3de966)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
We will need to call REST API endpoints from Cypress tests, and more
specifically from Cypress's tasks.
It will be useful to reuse what has been done in http-client.js instead
of using the low-level fetch JS function.
1. Add missing get and getAll functions
2. Allow overwrite of return_response and mark_submitting
3. Add a "default" client that will bring flexibility (can call any
routes)
4. Add rspack config to generate
t/cypress/plugins/dist/api-client.cjs.js that will make it reusable
from Cypress's tasks
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch renames the app from vendors to acquisitions to allow further acquisitions pages to be migrated
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds the base vue app as well as the component to list vendors
Amended-by: Jonathan Druart
chmod 755 acqui/vendors.pl
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
- For now let's not rely on rspack's native css loader to parse and
bundle styles as we need to preserve compatibility.
- Reintroduce configuration block for style-, css-loader for islands.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
- Remove 'experiments: css' for the first config block since it seems to do 2 passes when building the css.
- Remove style-, css-loader configuration for islands as I assume it is unneeded in this case.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
- Split the rspack config into a umd and an esm section.
- Don't hydrate by default.
- Instead check the "init" attribute for the currentScript when using the umd.
- Allow for manual import and call when using the esm.
- Add examples for both in intranet-main.tt (to be removed).
- Add a DialogIsland wrapper for the shared Dialog component (to map props to stored refs).
- Move DialogIsland as well as Demo components into an Islands directory under components.
- Add i18n initialisation to hydrate's idle callback.
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
- This would require us to update vue to a new minor version.
- We could then use the defineCustomElement function with the shadowRoot option set to false (this is important).
- The current implementation in islands.ts is naive and would result in an intolerable bundle size.
- The right way to do code splitting here is to use dynamic imports.
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This is pretty bare bones, but might still be interesting to take a look at.
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit addresses an issue where jQuery and DataTables libraries (datatables.net and related extensions) were not functioning correctly when bundled with rspack. These libraries expect to be loaded in the global scope rather than as bundled modules, leading to initialization issues.
To resolve this, jQuery and all related DataTables libraries (datatables.net, datatables.net-buttons, datatables.net-buttons/js/buttons.html5, etc.) are marked as externals in the rspack configuration. This ensures they are treated as global dependencies, preventing conflicts and allowing proper initialization.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
I left the webpack.config.js as well as the devDependencies in place for now.
We can remove them in a follow-up patch on this bug after testing it out.
To test:
1) Run js:build and js:build:prod
2) Note the build time
3) Apply patch
4) Run yarn install
5) Run js:build and js:build:prod again
6) Note the much faster build time
7) Extra credit: take a look at the ERM or preservations module and make sure everything works as expected.
8) Extra credit: run the cypress tests.
9) Sign off or give your opinion
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks faster to me. Where webpack failed for me (Killed, error 137), this passed.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>