Skip to content

PR 5/6: React Migration — PWA Support & Analytics#46

Open
devanshi-gpta wants to merge 1 commit into
react-migration/pages-and-routingfrom
react-migration/pwa-and-analytics
Open

PR 5/6: React Migration — PWA Support & Analytics#46
devanshi-gpta wants to merge 1 commit into
react-migration/pages-and-routingfrom
react-migration/pwa-and-analytics

Conversation

@devanshi-gpta

@devanshi-gpta devanshi-gpta commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Fifth PR in the 6-part Angular→React migration. Adds Progressive Web App support via vite-plugin-pwa and a page-view tracking hook.

PWA configuration (vite.config.ts):

  • VitePWA({ registerType: 'autoUpdate' }) — service worker auto-updates on new builds
  • Manifest: Conduit — RealWorld Example App, #5CB85C theme, standalone display, portrait orientation
  • Workbox runtime caching: NetworkFirst for api.realworld.show/api/* with 50-entry / 5-min cache

Page tracking (src/hooks/usePageTracking.ts):

  • usePageTracking() hook listens to useLocation() changes
  • Fires gtag('config', ...) with page_path on each navigation
  • Wired into AppRoutes component in App.tsx

Build output now includes sw.js, workbox-*.js, registerSW.js, and manifest.webmanifest.

Link to Devin session: https://app.devin.ai/sessions/6215127f80d4463cad3055cf81b87f0c
Requested by: @devanshi-gpta


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

- Configure vite-plugin-pwa with autoUpdate registration
- Add web app manifest (name, icons, theme color, display mode)
- Add Workbox runtime caching: NetworkFirst for API requests
- Create usePageTracking hook using useLocation() for GA page views
- Wire tracking hook into AppRoutes component
- Build produces sw.js, workbox runtime, and manifest.webmanifest

Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

1 participant