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 PWA features to the template #37

Open
rlopzc opened this issue Aug 10, 2018 · 2 comments
Open

Add PWA features to the template #37

rlopzc opened this issue Aug 10, 2018 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rlopzc rlopzc added enhancement New feature or request help wanted Extra attention is needed labels Aug 10, 2018
@timcase
Copy link

timcase commented Oct 24, 2018

I don't think adding PWA features to this template is a good idea. It's my opinion that the typical user of your template is just building a plain old web app and they won't be doing anything PWA so this imposes a default that most won't use. The second reason is more subtle but I think more important, I think Elm users should not be given the idea that creating a PWA could be as simple as generating an app manifest and serviceworker.js and attached your project to them.

An app manifest will allow a user of an app to add the app to their mobile home screen and then launch the app as if it were native. App manifests can be generated and I think the most useful generator can be found at www.pwabuilder.com because the generator builds an app manifest based on values and app icons uploaded by the user. Any app manifest you provide in a starter kit might be placeholder but it's not very helpful.

The real problem however is with service workers. Service workers allow for the really interesting features for which a person might want to do a PWA. For instance, caching and offline functionality. In order to take advantage of serviceworkers an app must make it's requests with the fetch api. Elm makes it's requests with xmlhttprequest and thus is INCOMPATIBLE with building a service worker out of the box.

In short

  1. Most elm webpack starter kit users are not building a PWA so it's a poor choice for a default
  2. Adding it as a default in a starter kit kinda implies that doing a PWA in Elm is so easy that it's something you can just add to any Elm project. It's not. The people who really need to do PWA will able to add this themselves manually.

I don't mean to be a debbie downer and I hope somebody contradicts me by saying PWA in Elm is easy, but I found that not to be the case and I'm trying to help others learn what I did the hard way.

source: https://www.reddit.com/r/elm/comments/7yjiao/elm_progressive_web_apps_service_workers_and/

@rlopzc
Copy link
Owner Author

rlopzc commented Oct 26, 2018

Hi @timcase

Thanks a lot for the explanation and the reasons why not add PWA features. As you can see I've been hesitant on how to make it because I didn't know how.

Everything is still on research/PR and that's why it hasn't been approved/merged. I may do a separate branch on how to achieve or get to the most of a PWA in Elm.

This issue can also be a place to gather information about Elm PWA as you are already doing.

Again, thanks for the information and I hope you find this template useful. Is always on development 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants