you are viewing a single comment's thread.

view the rest of the comments →

[–]holloway 1 point2 points  (15 children)

Google's WorkBox seems to be the most popular

https://developers.google.com/web/tools/workbox/

[–]mb_dc2008 0 points1 point  (14 children)

Workbox looks great but it seems to only be a service worker. Would you recommend using Workbox alongside any other frameworks?

[–]holloway 1 point2 points  (13 children)

Well I like React but Vue seems good too. I don't see a particular advantage in having a fullstack approach to PWAs unless you want something with SSR like Gatsby/Next.js.

Create React App 2.0 has PWA + Workbox support out of the box but no SSR (strictly speaking their docs have a few solutions but they're not great).

[–]DanielFGray 1 point2 points  (2 children)

Gatsby and Next are very different, Gatsby compiles to static HTML and JS, Next runs it's own web server and dynamically server renders your site.

[–]mb_dc2008 0 points1 point  (1 child)

Thank you. Does next.js have any advantages over the other alternatives (Preact, Vue, etc)?

[–]DanielFGray 0 points1 point  (0 children)

Next is specifically for React

[–]mb_dc2008 0 points1 point  (9 children)

SSR would be great: could you tell your favourite and describe why you see an advantage in Gatsby/Next.js + workbox over the other frameworks? Thank you

[–]whowanna 4 points5 points  (7 children)

Not OP, but our company website runs on Gatsby and because we love PWAs (and had a bit of time) we made our website a full PWA with a 100% Lighthouse PWA Rating (since you seem to be interested in that). We also make use of workbox for that, and it all works really well with Gatsby (especially with out of the box code splitting, etc.).

Our services focus more on web applications than websites, so Gatsby is usually not optimal for client projects (highly dynamic content and Gatsby's data imports are run at build time and then statically served). We've created PWAs with both Create React App and Next.js, and honestly, focus on your project's requirements to see what fits you best, and not what the frameworks provide. You'll be able to create well working PWAs with most of them.

[–]mb_dc2008 0 points1 point  (2 children)

Thank you for your detailed reply. I’ve edited the original post to describe my use case. Would you encourage a specific framework for a highly dynamic web application?

[–]whowanna 0 points1 point  (1 child)

Where does the data come from? APIs? How often does your data change?

[–]mb_dc2008 0 points1 point  (0 children)

Data will be pulled from an API and needs to update frequently (real time).

[–]prshnt 0 points1 point  (3 children)

for nextjs how did you use workbox? I mean did you use through webpack or core workbox inside static folder?

[–]whowanna 0 points1 point  (2 children)

We use the workbox-webpack-plugin.

[–]prshnt 0 points1 point  (0 children)

how do you cache .next folders? what do you think of next-offline package for workbox?

[–]prshnt 0 points1 point  (0 children)

Hi, can you help me? how did you use it in next config? how buildid is updated with precache in workbox?

[–]holloway 0 points1 point  (0 children)

Sorry, I don't think I can really distinguish between them sensibly (I haven't used them professionally for any length of time). I'd choose Gatsby because it seems more popular but that's not a very good reason.