Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "offline mode" support #71

Open
supernintendo opened this issue Nov 30, 2023 · 2 comments
Open

Add "offline mode" support #71

supernintendo opened this issue Nov 30, 2023 · 2 comments
Labels
enhancement New feature or request v0.3 Hex release 0.3

Comments

@supernintendo
Copy link
Contributor

supernintendo commented Nov 30, 2023

This ticket is to implement "offline mode", which will allow LiveView Native applications to run entirely within the native environment without a persistent Internet connection. A few implementation concerns:

  1. This will require running an instance of the BEAM VM on device; the method to deploy and run BEAM will differ depending on the target environment.
    • For desktop environments like SwiftUI for macOS, WinUI etc. this should be as easy as running the compiled Erlang app as any other process on the host OS. For environments like iOS and Android this might involve a more specialized linking process.
    • Each platform library will need to provide its own method of loading BEAM into the native environment and interfacing with it from the LiveView Native client application.
  2. Ideally, offline mode should be integrated with mix release so that packaging LVN apps to run on device is as easy as packaging them to run in other environments (like servers for example). This will also ensure compatibility will existing CI toolchains.
  3. Distributed Erlang could be used to synchronize the local Erlang app with remote instances. Should we provide abstractions for this or let end-user developers figure it out themselves?

Prior art:

@supernintendo supernintendo added v0.3 Hex release 0.3 enhancement New feature or request labels Nov 30, 2023
@AZholtkevych AZholtkevych moved this to Todo in LiveView Native Dec 13, 2023
@supernintendo supernintendo removed their assignment Dec 19, 2023
@AZholtkevych AZholtkevych moved this from Todo to On Hold in LiveView Native Jan 4, 2024
@AZholtkevych AZholtkevych moved this from On Hold to Todo in LiveView Native Feb 21, 2024
@mjrusso
Copy link

mjrusso commented Sep 29, 2024

This tweet by @bcardarella sums up really well where this could go:

  • run Phoenix server on device
  • connect on-device server to cluster (using Distributed Erlang)
  • layer in a local-first persistence layer (e.g. see Phoenix Sync proposal)

IMO the "run Phoenix server on device" part is compelling on its own, as a phase 1. (In a given app, some views could be powered by the on-device server, and others by the remote server.)

@bcardarella
Copy link
Contributor

There is an effort to extract ElixirKit out of Livebook and this likely will be how to implement offline mode. However, @LostKobrakai showed me a spike he wrote using Elixir Burrito and I have to investigate this: https://github.com/LostKobrakai/neovio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v0.3 Hex release 0.3
Projects
Status: Todo
Development

No branches or pull requests

3 participants