flexxui / flexx

Write desktop and web apps in pure Python
http://flexx.readthedocs.io
BSD 2-Clause "Simplified" License
3.25k stars 257 forks source link

Deployment scenarios #222

Open almarklein opened 8 years ago

almarklein commented 8 years ago

This issue serves to get a clearer picture on the scenarios of deployments of Flexx. To see what is needed implementation wise, to see what we might need to improve w.r.t. testing, etc. From this we should spin off issues for specific tasks.

Deployment scenarios

Browser support

We need to think what browsers we support, and what we do when Flexx runs on an unsupported browser (warn/err?). Browsers that should try to support are at least Firefox, Chrome, Edge, Safari?, and the native browsers for Android, Safari mobile and Edge mobile.

App, runtime, export

Anything in (2) as well as (1.7) is considered "exporting" an app. The logic for this should probably be implemented in a new subpackage.

Exporting mobile apps can probably be done with the help of existing tools like cordova and manifold.js. Some cross-overs are possible too: a Windows UWP runs on mobile and on desktop.

Fallback UI

For (1.7) we badly need a fallback way to communicate with the end user. Earlier ideas about this involved small lib based on OpenGL using GLFW to provide a window. An easier approach might be to use a simple (as in runs-anywhere, no Flexx-ui) web app --- since there is a browser anywhere. Maybe use .hta on Windows to make it look more like a dialog.

Korijn commented 8 years ago

No Electron or NW.js?

almarklein commented 8 years ago

My brain must have short-circuited: I wrote "Lightning", but I meant "Electron". Fixed it. And sure, NW.js falls in the same category.

niki-sp commented 8 years ago

Is PyQt or PySide suitable for 1.6 and 1.7? I can provide ~4 line ctypes based message dialog for Windows.

almarklein commented 8 years ago

Is PyQt or PySide suitable for 1.6 and 1.7?

I am not sure. The point is that the Qt webbrowser component might not be "modern" enough. It for sure won't work on PyQt4, I'd have to try for PyQt5 (see #167).

almarklein commented 8 years ago

I can provide ~4 line ctypes based message dialog for Windows.

I'd be very interested in those 4 lines :) We'd need a solutions for any platform, but that would be an awesome start.

niki-sp commented 8 years ago
def msg():
    from ctypes import windll
    MBW = windll.user32.MessageBoxW # unicode
    MBW(0, u'missing runtime', u'flexx', 16)

if __name__=='__main__':
    msg()
Korijn commented 8 years ago

With regard to scenario 1.7 I found this article and thought I'd share: https://www.fyears.org/2015/06/electron-as-gui-of-python-apps.html

almarklein commented 8 years ago

I think that blog post expresses very similar ideas as Flexx (and in particular flexx.webruntime). One difference is that in that post Electron spawns Python instead of the other way around.