Skip to content

Commit b34bd88

Browse files
committed
Replace local component loader with [email protected] module loader
1 parent bee00f3 commit b34bd88

File tree

3 files changed

+5
-119
lines changed

3 files changed

+5
-119
lines changed

public/js/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ function initRouter() {
7373
window.router = router;
7474
}
7575

76-
// Import utilities
77-
import { detectAndImportModules, filterScriptTags } from './utils/component-loader.js';
76+
// Import utilities from spa-router
77+
import { componentLoader } from 'https://esm.sh/@profullstack/[email protected]';
7878
import {
7979
initLoginPage,
8080
initRegisterPage,
@@ -128,10 +128,10 @@ async function loadPage(url) {
128128
const tempDiv = document.createElement('div');
129129

130130
// Automatically detect and import module scripts
131-
await detectAndImportModules(doc);
131+
await componentLoader.detectAndImportModules(doc);
132132

133133
// Filter out script tags (they'll be imported dynamically)
134-
const contentWithoutScripts = filterScriptTags(doc.body);
134+
const contentWithoutScripts = componentLoader.filterScriptTags(doc.body, true); // Keep script tags
135135
content = contentWithoutScripts.innerHTML;
136136
}
137137

public/js/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Router module for SPA navigation
33
*/
4-
import { Router, transitions, renderer, componentLoader } from 'https://esm.sh/@profullstack/spa-router@1.6.0';
4+
import { Router, transitions, renderer, componentLoader } from 'https://esm.sh/@profullstack/spa-router@1.7.0';
55
import { localizer } from './i18n-setup.js';
66
import {
77
initLoginPage,

public/js/utils/component-loader.js

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)