chore(frontend): remove custom Webpack sqlite-wasm integration plugins and cleanup config
- Deleted `dummy.js` and its usage for sqlite-wasm integration as custom Webpack adjustments are no longer necessary. - Removed outdated Webpack configuration files: `ignore-sqlite-wasm.js`, `ignore-sqlite-wasm-critical-dependency.js`, and `sqljs-fix.js`. - Introduced `sqlite-config.js` for simplified and streamlined sqlite-wasm and Skiko Webpack configuration. - Minor code formatting adjustments across frontend modules for improved consistency.
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
// This is a dummy file to satisfy Webpack's requirement for sqlite3.wasm and other modules.
|
||||
// It mimics the structure of the sqlite3-wasm module to prevent build errors.
|
||||
|
||||
// The worker code imports it like this:
|
||||
// import sqlite3InitModule from '@sqlite.org/sqlite-wasm';
|
||||
|
||||
// So we need a default export that is a function.
|
||||
// This function should mimic the behavior of sqlite3InitModule, which returns a Promise.
|
||||
export default function dummySqlite3InitModule() {
|
||||
// Since we are manually loading the WASM binary in the worker, this dummy module
|
||||
// is primarily here to satisfy Webpack's resolution and prevent errors.
|
||||
// It doesn't need to actually load the WASM.
|
||||
return Promise.resolve({});
|
||||
};
|
||||
@@ -15,7 +15,7 @@
|
||||
<script>
|
||||
// Prefer explicit query param override (?apiBaseUrl=http://host:port),
|
||||
// then fall back to same-origin. This avoids Docker secrets and works with Nginx proxy.
|
||||
(function(){
|
||||
(function () {
|
||||
try {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const override = params.get('apiBaseUrl');
|
||||
@@ -29,13 +29,13 @@
|
||||
}
|
||||
})();
|
||||
// KMP bundle will read globalThis.API_BASE_URL in PlatformConfig.js
|
||||
</script>
|
||||
</script>
|
||||
<script src="web-app.js"></script>
|
||||
<script>
|
||||
// Register Service Worker only in non-localhost environments
|
||||
if ('serviceWorker' in navigator && !['localhost', '127.0.0.1', '::1'].includes(location.hostname)) {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('/sw.js').catch(function(err){
|
||||
window.addEventListener('load', function () {
|
||||
navigator.serviceWorker.register('/sw.js').catch(function (err) {
|
||||
console.warn('ServiceWorker registration failed:', err);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Dummy module to satisfy WASI imports in Webpack
|
||||
// Used for skiko.wasm and potentially others
|
||||
|
||||
export function abort() {
|
||||
console.error("WASI abort called");
|
||||
}
|
||||
|
||||
// Some WASM modules might look for these
|
||||
export function emscripten_notify_memory_growth() {
|
||||
}
|
||||
|
||||
export default {
|
||||
abort,
|
||||
emscripten_notify_memory_growth
|
||||
};
|
||||
Reference in New Issue
Block a user