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

feat: progressive web app service worker #1347

Closed
wants to merge 3 commits into from

Conversation

chsasank
Copy link

Please see discussion here: #1337

@CLAassistant
Copy link

CLAassistant commented Jul 13, 2020

CLA assistant check
All committers have signed the CLA.

@chsasank chsasank changed the title Make Outline proper progressive web app with caching feat: progressive web app service worker Jul 13, 2020
Comment on lines +144 to +145
"cdn.jsdelivr.net",
"storage.googleapis.com",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this without adding two more third-party dependencies? I really don't want to add the entirety of these two CDN's to the CSP allow-list and I think it would be beneficial to keep dependencies bundled with the application.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We certainly can host these in outline in public folder or using yarn. But if only you can guide me, where or how, it'll make my life easy :)

Comment on lines +40 to +45
<script type="module">
// PWA: https://www.pwabuilder.com/serviceworker
import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
const el = document.createElement('pwa-update');
document.body.appendChild(el);
</script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UI that this provides doesn't match the rest of the application, I think we'd need to find a way to have it use the regular toast system that is already built in.

I feel like the knock on affects of potentially serving cached assets and js bundles might be quite significant and unpredictable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this is not very unrelated to the above right? If you can guide me to a tutorial how to do this, I'll implement it. Thanks.

@chsasank
Copy link
Author

chsasank commented Sep 27, 2020

Hi @tommoor,

I want to revive this PR and make progressive web app to your liking. We can then use this PWA to make both electron (i.e desktop) and android phone apps! Looks like this is going to be future: https://medium.com/pwabuilder/microsoft-and-google-team-up-to-make-pwas-better-in-the-play-store-b59710e487

This is also a good direction because of the fact that outline is based on react and existence of react native!

It'd be great if you can guide me through with how you want to get the PWA integration done! I'll also raise an issue asking for help in PWA builder repo.

@tommoor
Copy link
Member

tommoor commented Sep 28, 2020

In terms of closer integration with the build system, it seems there are two webpack plugins that can do almost 99% of the work:

https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin
https://www.npmjs.com/package/webpack-pwa-manifest

This would keep all of the config inside of webpack and not need additional files and third party script injection

@chsasank
Copy link
Author

I was considering writing react component to make PWA easy. What do you think?

@tommoor
Copy link
Member

tommoor commented Sep 28, 2020 via email

@chsasank
Copy link
Author

chsasank commented Sep 28, 2020

I mean a small react component that we can keep in app.js or something will all the features of pwabuilder.

Sorry but I'm relatively a noob in js stuff. Don't judge me 🙈

@tommoor
Copy link
Member

tommoor commented Dec 29, 2020

closing due to inactivity

@tommoor tommoor closed this Dec 29, 2020
@tommoor tommoor mentioned this pull request Feb 14, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants