Skip to content

feat(web): migrate PWA to Serwist#30808

Merged
asukaminato0721 merged 3 commits intomainfrom
1-10-drop-pwa
Jan 10, 2026
Merged

feat(web): migrate PWA to Serwist#30808
asukaminato0721 merged 3 commits intomainfrom
1-10-drop-pwa

Conversation

@hyoban
Copy link
Member

@hyoban hyoban commented Jan 10, 2026

Summary

  • replace next-pwa with Serwist turbopack integration and service worker route
  • register Serwist provider in the app layout with offline precache support
  • update dependencies to add Serwist and drop babel/next-pwa

Testing

  • Not run (pre-commit hooks ran eslint --fix and type-check:tsgo)

Fixes #30792

Copilot AI review requested due to automatic review settings January 10, 2026 06:56
@hyoban hyoban requested a review from iamjoel as a code owner January 10, 2026 06:56
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 💪 enhancement New feature or request labels Jan 10, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hyoban, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the application's Progressive Web App (PWA) capabilities by transitioning from the 'next-pwa' library to 'Serwist'. This change enhances the PWA's performance and reliability, particularly in offline scenarios, by leveraging Serwist's advanced service worker features and Next.js Turbopack integration. The update involves restructuring PWA-related code and optimizing dependencies to align with the new architecture.

Highlights

  • PWA Migration: The existing Progressive Web App (PWA) implementation has been migrated from 'next-pwa' to 'Serwist' for improved functionality and integration with Turbopack.
  • Serwist Integration: A new 'SerwistProvider' has been registered in the application layout, enabling offline precaching capabilities for a more robust user experience.
  • Dependency Management: Dependencies have been updated to include 'Serwist' and its related packages, while 'next-pwa' and 'babel' related dependencies have been removed, streamlining the project's package footprint.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully migrates the PWA implementation from next-pwa to Serwist. The changes are well-executed, including updating dependencies, removing the old next-pwa configuration, and setting up the new Serwist service worker and route. The new service worker implementation correctly preserves the existing caching strategies. I have identified a potential issue in the service worker route that could lead to a server crash if git is not available, and I've provided a suggestion to make it more robust. Additionally, I've suggested a minor refactoring in the service worker file to improve code readability by using constants for time durations.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request migrates the PWA implementation from next-pwa to Serwist, a modern service worker library with better Next.js 15 and Turbopack support.

Changes:

  • Replaced next-pwa with @serwist/turbopack for service worker generation and integration
  • Removed Babel-related dependencies (@babel/core, babel-loader) that were only needed for next-pwa
  • Implemented a custom service worker with runtime caching strategies using Serwist APIs
  • Added a dedicated service worker route at /serwist/[path]/route.ts for dynamic service worker generation

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
web/pnpm-lock.yaml Updated dependency lock file to reflect removal of next-pwa/babel packages and addition of Serwist packages
web/package.json Removed next-pwa, @babel/core, babel-loader; added @serwist/turbopack, serwist, and esbuild-wasm
web/next.config.js Removed withPWA wrapper and configuration; added esbuild-wasm to serverExternalPackages
web/knip.config.ts Removed babel-loader from ignoreDependencies list
web/app/sw.ts New service worker implementation with Serwist, including runtime caching strategies and offline fallback
web/app/serwist/[path]/route.ts New route handler for serving the service worker with dynamic precache entries
web/app/layout.tsx Integrated SerwistProvider wrapper around the app to register the service worker
web/app/components/provider/serwist.tsx New client component that re-exports SerwistProvider from @serwist/turbopack
Files not reviewed (1)
  • web/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

4 participants