Live data from Hacker News

WordPress WASM

github.com

1–10 of 69 posts

Re: WordPress WASM

#4
I think this is a really compelling pattern for converting traditional server rendered apps to be offline enabled (or choosing to build new ones this way). I have seen similar examples using Python.

Initially these are more of a “backed data” type app, with no offline public writes. [0]

The next step is to have local/offline SQLite to server syncing, enabling writes while offline that are synced back to the server on reconnection. This would inherently be eventually consistent and brings its own issues with relational data integrity, however the SQLite Session Extension could be I good way to build such a system [1]

The alternative is a new data store based on CRDTs (conflict free merging of offline edits), there are some exciting developments happening in that area. I have seen it suggested that the SQLite session extension is almost a crdt if you squint at it.

0: https://simonwillison.net/2021/Jul/28/baked-data/

1: https://www.sqlite.org/sessionintro.html

Re: WordPress WASM

#5
WASM may offer the most secure-by-default installations of Wordpress to ever exist.

This is seriously impressive -- I think we're getting a glimpse of a world where people can really run server side apps on their computers easily.

Add an app store and the web will have finished becoming the platform that everyone has been suspecting it is.

Re: WordPress WASM

#6
post #3

What does it even mean to run PHP in the browser... Is this supposed to be some sort of replacement for server-side PHP?

Skip React/Vue/Svelte/next week's JS framework and client-side render your app directly in PHP, genius. /s

Re: WordPress WASM

#7
post #3

What does it even mean to run PHP in the browser... Is this supposed to be some sort of replacement for server-side PHP?

First thing that came to mind is that I could load this up on a static host, saving content in a local SQLite (or even in SQLite in S3), make changes and then export the results to S3 as static HTML files. All without ever running any PHP/SQL host. One could technically upload this to GitHub Pages.

Endless possibilities!

Re: WordPress WASM

#8
post #2

Some ideas for persisting the SQLite database in IndexedDB: https://github.com/jlongster/absurd-sql

The tldr, is that AbsurdSQL uses IndexedDB to make WASM SQLite ACID compliant. The alternative is to pause writes and dump the whole db as a string to indexeddb, very slow, and not durable.

AbsurdSQL is an incredible hack, but is a hack at best.

There is a new api, File System Access and the “origin private file system”[0], coming to browsers that has been design specifically with WASM SQLite in mind. I believe the Chrome team have been collaborating with the SQLite team to ensure it will work well. Once this drops it’s going to bring a lot of innovation.

0: https://web.dev/file-system-access/#accessing-files-optimize...

Re: WordPress WASM

#9
post #6
post #3

What does it even mean to run PHP in the browser... Is this supposed to be some sort of replacement for server-side PHP?

Skip React/Vue/Svelte/next week's JS framework and client-side render your app directly in PHP, genius. /s

This just replaces the frontend framework written in JS with a frontend framework written in PHP compiled via wasm. It doesn't eliminate the need for something to manage views and state on the front end, as that's where you're executing all of your code now?

Re: WordPress WASM

#10

WASM may offer the most secure-by-default installations of Wordpress to ever exist. This is seriously impressive -- I think we're getting a glimpse of a world where people can really run server side apps on their computers easily. Add an app store and the web will have finished becoming the platform that everyone has been suspecting it is.

And thanks to Chrome one severe bug will effect all around the globe.

Monocultures are susceptible to pests and diseases

Post reply on HN