Sneak preview for the new nostr:nprofile1qqs8wfkyxlx00y0kmmvhmwkps3hxyqv7t77jfapwnke0vs8jx8pupxsx8yfv2

All the Nostr logic has been moved to a web-worker and rewritten in go-wasm.

The UI thread only job is to render what the worker is sending it, notes that are already parsed, filtered, decoded etc...

The web worker is acting like a local server.

https://video.nostr.build/116ce3db565aa08bd7d37cbc1a836e8240e93bbb34cf07fec533f4fd2c5f6461.mp4

Reply to this note

Please Login to reply.

Discussion

pay attention to the "Debug Metrics" at the bottom left of the screen, real time profiling thanks to go-wasm!

Almost there, just need to find a decent icon now

nevent1qqst8706rl2ev3gzwc92x64vzksgy40caltpry82q2vu5gllll00ewsppemhxue69uh5qmn0wvhxcmmvvxwlx9

This is the way.

nostr:note1k0ul5874jezsyas25d42c9dqsf2l3m7kzxgw5q5eeg3lll77ljaqd985tf

Using web workers is a game changer.

Combining it with wasm does increase the app speed and smoothness dramatically, both are underused in web dev today

Music to my ears❤️

I think that this is how every web nostr client will be written eventually, everything else makes little sense performance and even dev simplicity wise

Eventually yes, I’ll extract the web worker into a library, the nip worker library

awesome! great work man

Oh damn, this is cool!

Total noob when it comes to go and wasm.

How promising is this for multi-platform?

And what is taking care of the actual UI here?

In a browser you only get one thread, the JS thread. If you use a web worker, you can have one additional thread, that work in parallel to your UI thread.

Wasm (web assembly) is a standard that let you run binary code on your machine, this code can run close to native speed and use less memory.

The goal here is to free the JS thread as much as possible so that it is non blocking and smooth.

All code that is not related to the UI run at native speed in parallel.

The goal is to have the web run as fast as native app. So that we stop begging google and Apple to accept our libertarian apps