Live data from Hacker News

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

localfirstweb.dev

71–80 of 136 posts

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

#71
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

For a very similar scenario I'm currently looking to use PGlite: https://pglite.dev/ which is a 3MB WASM build of Postgres which also includes pgvector.

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

#72
post #27

> But I was equally surprised by how little this was being discussed, or (as far as I could tell) practiced in the real world. While there seemed to be endless threads on Twitter about server-side React (to get the UI generation closer to the data), no-one was talking about the opposite: moving the data to be closer to the UI, and onto the client! This, I've wondered for a while. There is plenty of talk about server…

Wasn't the reason for SSR to have more control over security and offload work from the client to the server? Let's not forget that the majority of the worlds population is using slow ass tech. We cant simply put huge workloads to the client.

I think the main drive for the modern version SSR was SEO. The workload part? the whole point of SPAs was to move compute - especially fancy UI compute down to the client so the server only had to move data... so we're just completing the circle again.

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

#73

> But I was equally surprised by how little this was being discussed, or (as far as I could tell) practiced in the real world. While there seemed to be endless threads on Twitter about server-side React (to get the UI generation closer to the data), no-one was talking about the opposite: moving the data to be closer to the UI, and onto the client! This, I've wondered for a while. There is plenty of talk about server…

SSR just means you render on the server, it isn't whatever you are describing.

It is exactly what I am talking about. Rendering the component on the server, takes up resources, as opposed to just sending that data to the client, and the client rendering it.

In Nextjs, "use client" is used to force the rendering to take place in the client, because many components cannot me rendered in the server. For example maps. In this case, it's unnecessary to use an SSR framework.

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

#74
Love the idea and the community aspect!

The issue with local first web dev in my experience is two fold:

1. It's super hard. The problem of syncing data is super hard to solve and there is little support from modern tooling. Mostly because it differs vastly on how you should handle it from app to app.

2. Very few that live in the west or people who pay for software are offline in longer stretches. There is simply very little to no requests for making apps work offline. I would argue to opposite that it probably is mostly bad business because you will get stuck on technical details due to #1 being so hard to solve. Even people who say they will use the app offline are never offline in my experience (from working on a real app that worked offline).

I work on an app that has clear offline benefits, although, pretty much no one will use it offline in practice and where I live, people have 5G access nowadays even at places that used to be offline, aka trains, tunnels etc. Even so, I plan to make my app offline supported but only after I have success with it.

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

#75
post #27

> But I was equally surprised by how little this was being discussed, or (as far as I could tell) practiced in the real world. While there seemed to be endless threads on Twitter about server-side React (to get the UI generation closer to the data), no-one was talking about the opposite: moving the data to be closer to the UI, and onto the client! This, I've wondered for a while. There is plenty of talk about server…

Wasn't the reason for SSR to have more control over security and offload work from the client to the server? Let's not forget that the majority of the worlds population is using slow ass tech. We cant simply put huge workloads to the client.

It was mainly for SEO, and to some extent protecting against website scrapers and crawlers.

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

#77
post #76

I don't understand, offline-capable software is now being pitched as something profound and genius? There was software before the widespread Internet access.

This is trying to give users all the benefits of being cloud connected (sync, collaboration, etc) without the requirement of always being connected.

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

#78
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

> (maybe even Windows might ship with Python nowadays?)

Windows doesn't ship with Python, but it does have a silly thing where if you type python in a command shell of your choice it will try to auto-install python. (When it works it is kind of magic, when it doesn't work it's a pain to debug the PATH problem.)

It's not exactly a one-liner, but in an off-the-shelf Windows install it is a short script to create a simple static file web server inside PowerShell.

Also there are npm and deno packages/CLIs that are easy to install/run for one-liners if you want to install something more "web native" than Python. `npx http-server` is an easy one-liner with any recent Node install.

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

#79
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".

It's a prominent checkbox in the Safari developer settings to enable this.
Post reply on HN