vuejs-templates / pwa

PWA template for vue-cli based on the webpack template
MIT License
3.04k stars 507 forks source link

Add Conditionally loaded fetch and promise polyfill #72

Open anubhav7495 opened 7 years ago

anubhav7495 commented 7 years ago

I think that we should also have an option asking the user for whether he wants to include polyfills for fetch and promise that are loaded conditionally using webpack.

I have seen preact-cli do that and I think it would be a nice to have feature.

Or we can also put in the documentation on how to set that up manually.

@addyosmani @ragingwind What are your thoughts?

ragingwind commented 7 years ago

As I understand, it is assumed that those of polyfills in preact-cli are used only in case of SSR. (not pretty much sure about promise). I think we can add SSR / Client hydration feature to this PWA template with polyfills. Documentation is not enough to encourage people to adapt SSR feature themselves.

ragingwind commented 7 years ago

I found this, discussion on SSR https://github.com/vuejs-templates/pwa/issues/33

MichaelJCole commented 6 years ago

The ServiceWorker API is built on Promises. I don't think a Promise polyfill is needed:

https://caniuse.com/#feat=promises https://caniuse.com/#feat=serviceworkers

I don't think for Fetch either: https://caniuse.com/#feat=fetch