![]() ![]() Often some part of the markup needs to be re-generated and rendered, as a result of changes.Ī gross generalization: code runs in the browser primarily to store state, capture events and manipulate DOMĪ lot of modern frameworks create significant abstractions on top of this basic utility, such as “lifecycles” for rendering, or finite state machines to manage data. In other cases, there is complex interplay between elements displayed on the webpage. Sometimes this is executing simple logic based on user interaction with the page, such as form entry validation. ![]() In a gross generalization, code runs in the browser primarily to store state, capture events and manipulate DOM. Well dear reader, what if I told you…įew JavaScript frameworks I’ve used have captured “simplicity” in the way that Svelte is designed. If only there is a way to combine the snappy UX of client side rendering in Svelte, with the strong-consistency state management of LiveView. This makes sense since data is stored in a database close to the server, and not accessible by the browser! However there are drawbacks to the user experience, as events need to make a round trip from the browser to the server and back whenever a user changes state. In contrast, LiveView (part of Elixir’s Phoenix framework) takes a contrarian view and insists that state should be managed only on the server. But since it’s running in a browser, there’s still the issue of fetching data from the server, and keeping that data state consistent between clients and backend servers. Svelte is a reactive JS framework that is delightful to use - it finds a perfect balance between simplicity and power. This post is based on a talk given at ElixirConf 2022 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |