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

PWAs #71

Open
arctic-hen7 opened this issue Oct 31, 2021 · 8 comments
Open

PWAs #71

arctic-hen7 opened this issue Oct 31, 2021 · 8 comments
Assignees
Labels
C-enhancement Category: enhancement D-hard Difficulty: hard P-medium Priority: medium S-in-design Status: in design
Milestone

Comments

@arctic-hen7
Copy link
Member

Is your feature request related to a problem? Please describe.
Progressive Web Apps (PWAs) have become incredibly powerful over the last few years, and can even work as viable Android apps now (see here). Right now, Wasm PWAs are practically nonexistent except for through Blazor, and Perseus has a significant opportunity to work with PWAs out of the box.

Describe the solution you'd like
This would likely be achieved with a plugin that adds PWA functionality. It would need to add the necessary manifest details, a few static assets, and a service worker. The last part is the hardest, because Wasm and service workers don't really work together yet, so this would probably have to be in JS for now. Nonetheless, it should be possible to cache the main Wasm binary and HTML/JSON resources without any changes to the Perseus server. However, E-Tag support on the server is long overdue, and this would improve cacheability and thus performance for non-exported apps.

Describe alternatives you've considered
A version of Perseus for apps, but that would require a ridiculous amount of work and would inevitably end up leading to fractured codebases.

Additional context
This is a tracking issue for PWAs in Perseus, and this should be a place for ideas on the topic as well as development updates. As I said, nearly all this work will occur in a plugin perseus-pwa, but there may also be some changes needed in the core.

@arctic-hen7 arctic-hen7 added C-enhancement Category: enhancement D-hard Difficulty: hard P-medium Priority: medium S-in-design Status: in design labels Oct 31, 2021
@arctic-hen7 arctic-hen7 added this to the v0.4.0 milestone Oct 31, 2021
@arctic-hen7 arctic-hen7 self-assigned this Oct 31, 2021
@arctic-hen7 arctic-hen7 pinned this issue Oct 31, 2021
@afidegnum
Copy link
Contributor

I have come across this, I don't know something can be useful from it.

This and this PWA

@arctic-hen7
Copy link
Member Author

Hmm okay, that looks really interesting, thanks! Woz seems to be archived now, but it's certainly something to look into for ideas and possible optimizations so we don't have to reinvent the wheel.

@erlend-sh
Copy link

The last part is the hardest, because Wasm and service workers don't really work together yet, so this would probably have to be in JS for now.

@dunnock might have input on this, having built https://github.com/dunnock/wasi-worker

@arctic-hen7
Copy link
Member Author

Hmm that could be extremely useful, thanks!

@afidegnum
Copy link
Contributor

But isn't perseus a kind of PWA on its own coupled with sycamore ?

@arctic-hen7
Copy link
Member Author

No, a PWA is installable; the name is a bit misleading (PWAs are actually a specific type of web app with certain extra metadata). This would allow Perseus to be used for the development of what are essentially mobile apps, just running in a WebView or similar. For example, PWAs can use APIs for music player controls on your phone's lockscreen, which would usually be gated behind the browser.

@afidegnum
Copy link
Contributor

ok, still exploring possibilities.

@arctic-hen7
Copy link
Member Author

Just a brief update on this front: once #173 is done, Perseus will be able to make pages interactive from a single document request, along with the Wasm and JS bundles, which should make future PWA support snappier. In terms of implementation plans, I'll aim to start exploring how exactly I want this to work (and how this would affect the core codebase) over the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement D-hard Difficulty: hard P-medium Priority: medium S-in-design Status: in design
Projects
None yet
Development

No branches or pull requests

3 participants