atdiar / particleui

A library to make frontend app development as simple as possible.
0 stars 0 forks source link

Hot Reloading and SSR replayability AND/OR State snapshot transfer #25

Closed atdiar closed 3 months ago

atdiar commented 4 months ago

Introduction

When reloading state (Hot/Live reloading, or Server-Side Rendering aka SSR), the logic for the dynamic mutations that can be applied to a webapp is handled via Wasm. One way to implement hot reloading and SSR is to record the chain of state mutation events and then replay them on the desired end-target.

Pros

An alternative is to take advantage of the fact that Wasm is running in a sandbox on the client and potentially on the server as well. That means that the state of the program (stack and heap) could be transferred almost as-is from the server to the client. Although, it would probably require parametrization of the allocator by a given offset.

Pros

Cons

atdiar commented 3 months ago

Replayability is in, implemented properly as far as I know, now. The other options require to be more low level. Could be revisited later if need be.