Live data from Hacker News

I wrote a static web page and accidentally started a community (2023)

localfirstweb.dev

41–50 of 136 posts

Re: I wrote a static web page and accidentally started a community (2023)

#41
post #21

Earlier quoted context omitted.

That requires having an actual server though.

which is extremely easy to do. Most programming languages have a one-liner to do it.

The best solution would allow both. Nothing quite as portable as shoving a .html file on a usb stick.

Re: I wrote a static web page and accidentally started a community (2023)

#42
post #15
post #5

Earlier quoted context omitted.

What I said. Local embedded SQLite and React is not tiny, it's huge. And slow. And native JS only is adequate for tiny first web. Clients do care about ms vs 5s load-times.

how do you say, implement full-text search in a local first manner? How about vector search? (don't even know if it's a thing yet, sounds possible these days). Imagine saving a local copy of a docs site (a sizable set of pages) and have search and stuff working perfectly

Build the index as a static file and query it using js? This has been my approach so far — admittedly, this isn't with millions of pages, but I'll continue to use it for as long as it works. When hosted on the internet, the search is still blazingly fast, way better than most other sites I come across.

Re: I wrote a static web page and accidentally started a community (2023)

#43

Earlier quoted context omitted.

I don't understand the downvote. OP said > a way to securely host local servers without root but also without just praying that another app doesn't port-squat me Binding to port 0 is a solution. I tested it and I always get a port not used by other programs.

I guess the main disadvantage is you can't reliably link to anything. Maybe not a problem if you only ever need one local server.

That's a good point. I assumed it being a single local server per app.

Re: I wrote a static web page and accidentally started a community (2023)

#44
post #6

Hey browser makers, please allow file:// URLS to actually be able to load other files in the same directory without giving a CORS error. You can't even run a JS file from the same directory! That's what's really killing "local first".

Luckily, starting a local HTTP server for development is more-or-less a one-liner for a long time, in most OSes (maybe even Windows might ship with Python nowadays?):

    python -m http.server 8080
If if you're stuck with python2

    python -m SimpleHTTPServer 8080
At least this doesn't introduce the security issues you'd see with any file:// resource being able to load other file:// resources

Re: I wrote a static web page and accidentally started a community (2023)

#45
Well, it's always amusing how they discover that applications can run locally without depending on someone else's servers and maybe without pulling unverified code from 50 random repos.

Next they'll discover native applications! Innovation!

Maybe after that they'll even discover that you can give a shit about the user's battery/power consumption and ram consumption again!

Re: I wrote a static web page and accidentally started a community (2023)

#46
post #38

I love the localfirst idea but I don't love web browsers. They're the platform everyone has to have but shoehorning 40 years of UI development and products into them seems like a mistake. I can see why local UI development fell out of favor, but it is still better (faster, established tooling, computers already have it so you don't have to download it). I can't help but feel like a lighter weight VM (versus electron)…

Love this. What are computers for? Local first could be the file format that allows us to use devices without cloud services. Back to file first, vendors of software apps, pay for software once (or one year of updates or whatever). It's s new horizon.

I would still prefer to have my stuff synced between devices. Files are OK for data that doesn't change much (your music/photo/book library) - Syncthing works great there.

CRDTs allow for conflict-free edits where raw files start falling short (calendars, TODOs, etc). I'd love to see something like Syncthing for CRDTs, so that local-first can take the next logical step forward and go cloud-free.

Re: I wrote a static web page and accidentally started a community (2023)

#47
post #45

Well, it's always amusing how they discover that applications can run locally without depending on someone else's servers and maybe without pulling unverified code from 50 random repos. Next they'll discover native applications! Innovation! Maybe after that they'll even discover that you can give a shit about the user's battery/power consumption and ram consumption again!

The key in local-first is the _first_. The stated goal is to give people the benefits of local applications (no spinners, data outlives the app) with the benefits of cloud applications (low-friction collaboration).

Re: I wrote a static web page and accidentally started a community (2023)

#48
post #44
post #6

Hey browser makers, please allow file:// URLS to actually be able to load other files in the same directory without giving a CORS error. You can't even run a JS file from the same directory! That's what's really killing "local first".

Luckily, starting a local HTTP server for development is more-or-less a one-liner for a long time, in most OSes (maybe even Windows might ship with Python nowadays?): python -m http.server 8080 If if you're stuck with python2 python -m SimpleHTTPServer 8080 At least this doesn't introduce the security issues you'd see with any file:// resource being able to load other file:// resources

It's not perfect either:

https://docs.python.org/3/library/http.server.html#http-serv...

You should also add a `--bind 127.0.0.1` so you don't expose the site to everyone on your network.

Re: I wrote a static web page and accidentally started a community (2023)

#49

Earlier quoted context omitted.

I don't understand the downvote. OP said > a way to securely host local servers without root but also without just praying that another app doesn't port-squat me Binding to port 0 is a solution. I tested it and I always get a port not used by other programs.

I guess the main disadvantage is you can't reliably link to anything. Maybe not a problem if you only ever need one local server.

Maybe this is an opportunity. Is there already a “DNS for ports” whereby the hosts file is propagated with application process identifiers that are mapped to localhost:port in hosts file?

Re: I wrote a static web page and accidentally started a community (2023)

#50

I love the localfirst idea but I don't love web browsers. They're the platform everyone has to have but shoehorning 40 years of UI development and products into them seems like a mistake. I can see why local UI development fell out of favor, but it is still better (faster, established tooling, computers already have it so you don't have to download it). I can't help but feel like a lighter weight VM (versus electron)…

> shoehorning 40 years of UI development and products into them seems like a mistake.

It wouldn't be such a mistake if it was done well. For all the bells and whistles web UIs have, they still lack a lot of what we had on the desktop 30 years ago, like good keyboard shortcuts, support for tab in forms, good mask inputs, and so on.

Post reply on HN