Skip to content

delaneyj/1a5s-datastar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1 App 5 Stacks ported to Go+Templ+Datastar

The original code that goes with this video I think did Go dirty.

Run

Haven't made a docker container yet but if you have Task and Go 1.23.3 installed you can run the following:

task tools
task -w

What's different?

  1. 321LOC of Go across 6 files (including HTTPServer) and ~125LOC of Templ across 3 files for UI. Could be one of each but tried to match the spirit of the original.
    1. Templ could be shorter but expanded lines for readability.
    2. Pretty sure it's the smallest codebase of any of the apps in the original.
  2. Metrics
    1. I'm pretty sure it's the fastest (queries take < 1ms on my machine)
    2. Smallest memory footprint (19MB sustained) of any of the apps in the original.
  3. It handles speculation rules asynchronously for precaching the pokemon images.
  4. Use pure Go SQLite so N+1 queries are not a problem.
  5. It's a single binary with no dependencies.
  6. Datastar
    1. One time cost of 12KiB of JS.
    2. Handles all UI interactions and backend communication.
    3. The version is ALL the plugins we are only using a handful of them for this demo
    4. No websockets, just normal HTTP requests that can work on HTTP 2/3.

I hope this clear up why it's not

from a glance like Live View

~ Theo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published