Live data from Hacker News

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

localfirstweb.dev

11–20 of 136 posts

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

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

If it's too big to include in a script tag, you don't need it. At least, that's my rule.

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

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

That and, bring back the "new tab" custom URL, and, a way to securely host local servers without root but also without just praying that another app doesn't port-squat me

You can bind to port 0 and have the OS then pick an available port for you.

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

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

I think the following works in Firefox. WARNING: this is a security risk obviously.

about:config -> security.fileuri.strict_origin_policy -> false

source: https://stackoverflow.com/questions/58067499/runing-javascri...

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

#15
post #5

Earlier quoted context omitted.

The "static page" is referring to https://localfirstweb.dev/ . TinyBase, the tool with embedded SQLite and React support (among other things) is for reactive (non-static) web applications. Native JavaScript language feature like maps are not an adequate replacement for the functionality offered by TinyBase.

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

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

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

> "local first"

Listening on 127.0.0.1:80 is local first and not being routable is in fact local-only. Its common alias ‘localhost’ even has ‘local’ in the name.

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

#17
post #5

Earlier quoted context omitted.

The "static page" is referring to https://localfirstweb.dev/ . TinyBase, the tool with embedded SQLite and React support (among other things) is for reactive (non-static) web applications. Native JavaScript language feature like maps are not an adequate replacement for the functionality offered by TinyBase.

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.

I agree on React, but not necessarily on SQLite. It's made for use cases like this and it can handle quite a lot of data with a humble footprint.

Ironically, if you use something browser native indexeddb plus JS instead, you are also likely indirectly using SQLite as far as I know.

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

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

You can totally load a JS file from the same directory, I do it all the time.

I recall you can't use web workers, but just loading a JS file with tags is fine.

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

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

That and, bring back the "new tab" custom URL, and, a way to securely host local servers without root but also without just praying that another app doesn't port-squat me

Use https://github.com/daisylb/newtab or other extension to load a home page when you open a new tab.

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

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

That and, bring back the "new tab" custom URL, and, a way to securely host local servers without root but also without just praying that another app doesn't port-squat me

Support for Unix sockets would be a gamechanger.
Post reply on HN