mysterious-toddler-20573
08/10/2020, 4:21 PMmysterious-toddler-20573
08/10/2020, 4:22 PMmysterious-toddler-20573
08/10/2020, 4:22 PMmysterious-toddler-20573
08/10/2020, 4:22 PMsalmon-truck-9425
08/10/2020, 4:52 PMmysterious-toddler-20573
08/10/2020, 4:52 PMmysterious-toddler-20573
08/10/2020, 4:52 PMmysterious-toddler-20573
08/10/2020, 4:52 PMbig-airline-13935
08/10/2020, 6:40 PMwooden-wall-85896
08/10/2020, 6:42 PMsalmon-truck-9425
08/10/2020, 7:49 PMsalmon-truck-9425
08/10/2020, 7:50 PMsalmon-truck-9425
08/10/2020, 7:50 PMsalmon-truck-9425
08/10/2020, 7:51 PMbig-airline-13935
08/10/2020, 7:52 PMconsole.log
?salmon-truck-9425
08/10/2020, 7:52 PMbig-airline-13935
08/10/2020, 7:53 PMsalmon-truck-9425
08/10/2020, 7:55 PMimport "htmx.org"
var Routes = {
'/somepage': () => import('somepage.js'); //somepage.js is an empty js file.
};
document.addEventListener("DOMContentLoaded", function() {
var currentRoute = document.body.getAttribute("data-page-route"); //this will be /somepage
if (currentRoute in Routes) {
Routes[currentRoute]().then((m) => {
// this loads somepage.js which is an empty file
console.log('loaded script for ${currentRoute}');
});
}
});
wooden-wall-85896
08/10/2020, 8:03 PMwooden-wall-85896
08/10/2020, 8:03 PMwooden-wall-85896
08/10/2020, 8:04 PMbig-airline-13935
08/10/2020, 8:10 PMbig-airline-13935
08/10/2020, 8:12 PMready
function:
https://github.com/bigskysoftware/htmx/blob/dev/src/htmx.js#L1663-L1669wooden-wall-85896
08/10/2020, 8:22 PMwooden-wall-85896
08/10/2020, 9:10 PMtall-dinner-62086
08/11/2020, 10:50 AM_hypserscript.start()
it duplicates event listeners on existing elements.mysterious-toddler-20573
08/11/2020, 1:13 PMmysterious-toddler-20573
08/11/2020, 1:14 PMsalmon-truck-9425
08/13/2020, 9:31 AMdocument.addEventListener("DOMContentLoaded", function () {
var currentRoute = document.body.getAttribute("data-page-route");
if (currentRoute in Routes) {
Routes[currentRoute]().then((m) => {
htmx.initialize();
});
}
});
why does this need special treatment for webpack? i don't know - it works under rollup. But then rollup blows for rest of my code...
to summarize YUCK all the webpack/rollup w/e build tools - incosistent blackboxes that do nothing but waste time ; (mysterious-toddler-20573
08/13/2020, 2:04 PM