minioctt<p>Colpo di <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/genio/" target="_blank">#genio</a> estremamente radicale per risolvere un annoso <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/problema/" target="_blank">#problema</a>: il creare una data <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/webapp/" target="_blank">#webapp</a>, che non abbia bisogno di grande interattibilità (vedi un social network, o un CMS), senza dover mantenere 2 <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/codebase/" target="_blank">#codebase</a> separate e quindi impazzire, facendola funzionare sia con un <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/server/" target="_blank">#server</a> che totalmente senza… ossia, come unire in una sintesi circa accettabile i due maggiori paradigmi del <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/frontend/" target="_blank">#frontend</a>? 🤔️</p><ul><li>Quello antico, delle prime <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/piattaforme/" target="_blank">#piattaforme</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/web/" target="_blank">#web</a>, dove il server genera tutto l’HTML e il browser lo visualizza com’è, spesso con (quasi) zero <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/javascript/" target="_blank">#JavaScript</a> (vedi la <a href="https://bbs.spacc.eu.org" rel="nofollow noopener noreferrer" target="_blank">Spacc BBS</a>). 📦️</li><li>Quello moderno, dove nel <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/backend/" target="_blank">#backend</a> si espongono API (spesso JSON REST), e il fronte viene sviluppato a parte come app che gira totalmente lato <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/client/" target="_blank">#client</a>, con il <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/browser/" target="_blank">#browser</a> che richiede pezzetti di dati e fa i suoi <em>iperprocessamenti</em>. 💱️</li></ul><p>Ormai quello antico non si usa quasi mai per <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/progetti/" target="_blank">#progetti</a> nuovi, perché gli svantaggi sono pesanti appena si vuole andare un po’ più in là: per tappare i buchi nel progetto medio si finirebbe a dover scrivere talmente tanto <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/codice/" target="_blank">#codice</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/clientside/" target="_blank">#ClientSide</a>, che a questo punto era meglio fare tutto nel secondo modo, senza menzionare i modelli e le <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/api/" target="_blank">#API</a> da esporre nel server che altrimenti non si sarebbero implementati. Però, le webapp antiche girano bene anche sul computer tascabile meno performante (average Ximi), sui browser vecchi, e spesso sono le uniche che vanno quando tutto il resto ti lascia a piedi. D’altro canto però, anche se in teoria quella <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/app/" target="_blank">#app</a> potrebbe funzionare <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/offline/" target="_blank">#offline</a>, magari mostrando dati <em>cachabili</em>, se è sviluppata in modo attaccato al server ecco allora che non si può fare nulla: muore il server, muore tutto. 💣️</p><p>Quindi la mia <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/idea/" target="_blank">#idea</a> paxxerella, dato che devo fare banalmente una <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/applicazione/" target="_blank">#applicazione</a> come <a href="https://poliverso.org/display/0477a01e-1765-c27f-1ca4-f9d992119359" rel="nofollow noopener noreferrer" target="_blank">frontend per un altro servizio già esistente</a>, ma voglio i vantaggi appena millantati: sviluppare con i paradigmi <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/serverside/" target="_blank">#ServerSide</a> in un framework JS adatto, che giri sia in Node che nel browser. A quanto pare, qualcuno ci ha pensato prima, e qualcosa di già fatto ho trovato (<a href="https://expressjs.com/" rel="nofollow noopener noreferrer" target="_blank">Express</a>+<a href="https://github.com/camelaissani/frontexpress" rel="nofollow noopener noreferrer" target="_blank">FrontExpress</a>, <a href="https://koajs.com/" rel="nofollow noopener noreferrer" target="_blank">Koa</a>+<a href="https://github.com/kentjs/koa-client" rel="nofollow noopener noreferrer" target="_blank">Koa-Client</a>, <a href="https://github.com/rill-js" rel="nofollow noopener noreferrer" target="_blank">Rill</a>)… ma è tutta roba ormai abbandonata, che o non funziona (ho provato) o ha altre <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/rogne/" target="_blank">#rogne</a>. Te pareva che trovavo mai qualcosa di buono già pronto… Però, in un quarto d’ora ho tirato su uno <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/script/" target="_blank">#script</a> scheletrino, giusto per poter partire per questa via. ☠️</p><p></p>Rapido <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/esempio/" target="_blank">#esempio</a>: questo <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/programma/" target="_blank">#programma</a> (giusto da <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/dimostrazione/" target="_blank">#dimostrazione</a>, non fa nulla se non mostrare questo testo e far navigare tra pagine) gira sia come server su <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/nodejs/" target="_blank">#NodeJS</a>, che come script in una pagina <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/html/" target="_blank">#HTML</a> totalmente <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/locale/" target="_blank">#locale</a>, e l’esperienza non cambia. Percepisco il potenziale, continuerò così. 😤️<p><a href="https://octospacc.altervista.org/2024/02/07/frontendare-lato-client-come-fossimo-nel-backend/" rel="nofollow noopener noreferrer" target="_blank">https://octospacc.altervista.org/2024/02/07/frontendare-lato-client-come-fossimo-nel-backend/</a></p><p><a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/api/" target="_blank">#API</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/app/" target="_blank">#app</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/applicazione/" target="_blank">#applicazione</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/backend/" target="_blank">#backend</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/browser/" target="_blank">#browser</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/client/" target="_blank">#client</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/clientside/" target="_blank">#ClientSide</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/codebase/" target="_blank">#codebase</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/codice/" target="_blank">#codice</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/dimostrazione/" target="_blank">#dimostrazione</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/esempio/" target="_blank">#esempio</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/frontend/" target="_blank">#frontend</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/genio/" target="_blank">#genio</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/html/" target="_blank">#HTML</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/idea/" target="_blank">#idea</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/javascript/" target="_blank">#JavaScript</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/locale/" target="_blank">#locale</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/nodejs/" target="_blank">#NodeJS</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/offline/" target="_blank">#offline</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/piattaforme/" target="_blank">#piattaforme</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/problema/" target="_blank">#problema</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/progetti/" target="_blank">#progetti</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/programma/" target="_blank">#programma</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/rogne/" target="_blank">#rogne</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/script/" target="_blank">#script</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/server/" target="_blank">#server</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/serverside/" target="_blank">#ServerSide</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/web/" target="_blank">#web</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://octospacc.altervista.org/tag/webapp/" target="_blank">#webapp</a></p>