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

Document The Vaadin Way for working with service workers #2792

Open
OlliTietavainenVaadin opened this issue Oct 3, 2024 · 2 comments
Open
Labels
documentation Improvements or additions to documentation hilla Issues related to Hilla

Comments

@OlliTietavainenVaadin
Copy link
Member

Service workers are useful for cases where extra caching and progressive improvement are needed, such as offline and poor network connectivity situations. Right now, there's no clear way on how service workers should interact with Hilla applications and Hilla endpoints. The Vaadin Way could document opinionated best practices for working here.

Some ideas for topics:

  • Working with CSRF tokens in service workers
  • Using Google WorkBox - yes, no, sometimes?
  • Cache strategies
    • What to cache and what not to
  • Passing message events - what to send and what not to send
  • How to account for Vaadin specifics in sw.ts
    • message event handling order - should Vaadin's internal messages be handled first?
  • Communication between the Hilla app and the service workers
  • Constructing callbacks
  • Message bus -style communication patterns
    • Example: chat messages that are synchronized in the background and pushed to the UI
  • Error handling in service workers
@OlliTietavainenVaadin OlliTietavainenVaadin added documentation Improvements or additions to documentation hilla Issues related to Hilla labels Oct 3, 2024
@peholmst
Copy link
Member

peholmst commented Oct 3, 2024

Is it technically possible to do all this right now, or are there any limitations in Hilla that must be addressed first?

@OlliTietavainenVaadin
Copy link
Member Author

Is it technically possible to do all this right now, or are there any limitations in Hilla that must be addressed first?

Technically yes, but it requires hacky workarounds right now. Related issues:
#2788
#2789
#2790
#2791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation hilla Issues related to Hilla
Projects
None yet
Development

No branches or pull requests

2 participants