insin / nwb

A toolkit for React, Preact, Inferno & vanilla JS apps, React libraries and other npm modules for the web, with no configuration (until you need it)
Other
5.57k stars 331 forks source link

Offline capability / SW #183

Open NekR opened 8 years ago

NekR commented 8 years ago

@insin are you interested in integrating offline-plugin into nwb? Do you think that would be possible with nwb's architecture? e.g. because offline-plugin requires runtime to be added to the entry file.

insin commented 7 years ago

Yes, definitely, I suppose that makes #203 a dupe of this, but I haven't used offline-plugin or the alternatives so don't know the pros and cons of each.

We can tweak entry config at any stage when we've detected that a feature has been enabled, be it cli options/user config or whatever.

NekR commented 7 years ago

@insin I think it's more like this blocks #203 since PWAs are more than just SW :-) I'll try to write pros and cons here of different libs today.

NekR commented 7 years ago

Okay, here are some pros/cons I wrote a while ago: https://github.com/facebookincubator/create-react-app/issues/192#issuecomment-235095536

Other thing, probably not mentioned there is that sw-precache and its wrappers for webpack work very bad with webpack-dev-server and probably some other things. The reason is that it sw-precache doesn't use webpack's built-in mechanism to output files, but rather just write it to the file system. This obviously couldn't work normally with dev-server since it uses in-memory file system.

Other pros of offline-plugin:

Other cons of offline-plugin:

/cc @developit

tomByrer commented 6 years ago

sw-precache has more stars & forks. offline-plugin is more recently & frequently updated.

Preact CLI uses sw-precache now. but Preact's website uses offline-plugin 😆

Any news adding one of these?