I know we've talked about this previously, mostly just logging this for future reference.
Using FLASH, or other JS-based compiler, you could import the newest build of the script, or CDN it (it comes from JSDelivr so it should be unblocked universally). Then you could include embedded YAML files that would work in single-file and also allow more complex-indepth sites, especially if you allowed links to be submitted via a CDN that the JS would parse.
Another thing:
This isn't a feature but a good UX suggestion.
Use CDNS (Content Delivery Network Script) for all CDN'd assets. I don't know how many there are, but this checks if there is a newer version, if so it updates, if not than it catches it for a faster load time. Basically auto update checking every time.
For Lupine what I did is my singlefile had the structure in an HTML file and everything else was CDN (virtually unblockable, same as embedding everything) on CDNS so then it auto updated which in turn:
a. reduced file size for download a TON
b. Made it so the users had to download the file one time and then just refresh whenever there was an update.
Also using Vite to compile into (1) JS file and (1) CSS file (both enormous) and just importing both into a root at HTML runtime would be a good idea. Lupine used a custom build script that auto CDN'd everything:
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const distDir = path.join(__dirname, '..', 'dist');
const indexPath = path.join(distDir, 'index.html');
if (!fs.existsSync(indexPath)) process.exit(0);
let html = fs.readFileSync(indexPath, 'utf8');
const cdnPrefix = 'https://cdn.jsdelivr.net/gh/rhenryw/lupine@main/assets/';
html = html.replace(/(<link[^>]+href=")([^"\>]+assets\/[^"]+)("[^>]*>)/g, (m, p1, p2, p3) => {
const file = p2.split('assets/').pop();
return `${p1}${cdnPrefix}${file}${p3}`;
});
html = html.replace(/(<script[^>]+src=")([^"\>]+assets\/[^"]+)("[^>]*><\/script>)/g, (m, p1, p2, p3) => {
const file = p2.split('assets/').pop();
return `${p1}${cdnPrefix}${file}${p3}`;
});
fs.writeFileSync(indexPath, html, 'utf8');
console.log('Rewrote asset links in dist/index.html to CDN.');
and was run at build with a custom package.json line: "build": "vite build && node scripts/rewrite-dist-cdn.cjs && node scripts/postbuild-move.cjs",.
I know we've talked about this previously, mostly just logging this for future reference.
Using FLASH, or other JS-based compiler, you could import the newest build of the script, or CDN it (it comes from JSDelivr so it should be unblocked universally). Then you could include embedded YAML files that would work in single-file and also allow more complex-indepth sites, especially if you allowed links to be submitted via a CDN that the JS would parse.
Another thing:
This isn't a feature but a good UX suggestion.
Use CDNS (Content Delivery Network Script) for all CDN'd assets. I don't know how many there are, but this checks if there is a newer version, if so it updates, if not than it catches it for a faster load time. Basically auto update checking every time.
For Lupine what I did is my singlefile had the structure in an HTML file and everything else was CDN (virtually unblockable, same as embedding everything) on CDNS so then it auto updated which in turn:
a. reduced file size for download a TON
b. Made it so the users had to download the file one time and then just refresh whenever there was an update.
Also using Vite to compile into (1) JS file and (1) CSS file (both enormous) and just importing both into a root at HTML runtime would be a good idea. Lupine used a custom build script that auto CDN'd everything:
and was run at build with a custom
package.jsonline:"build": "vite build && node scripts/rewrite-dist-cdn.cjs && node scripts/postbuild-move.cjs",.