Skip to content

Demo 4: Multi-store, cada tienda su propia PWA#34

Open
JuanVqz wants to merge 1 commit intodemo3-cache-strategiesfrom
demo4-multi-store
Open

Demo 4: Multi-store, cada tienda su propia PWA#34
JuanVqz wants to merge 1 commit intodemo3-cache-strategiesfrom
demo4-multi-store

Conversation

@JuanVqz
Copy link
Copy Markdown
Owner

@JuanVqz JuanVqz commented Apr 13, 2026

Summary

  • Rename service-worker.js to service-worker.js.erb to enable Ruby interpolation
  • Per-store cache name using current_store subdomain
  • Dynamic manifest with store name, icon, and colors via ERB
  • Add current_store helper in ApplicationHelper for Rails::PwaController access

Part of the PWA en Rails talk.

Test plan

  • Access via cafe subdomain, verify manifest shows "Cafe Delicias"
  • Access via pizza subdomain, verify manifest shows "Pizzeria Don Mario"
  • Check cache names differ per store in DevTools

Video

https://www.youtube.com/watch?v=ppxalpIKpGg

- Manifest personalizado por store con ERB (nombre, logo)
- Cache nombrado por subdominio para facilitar debugging
- Renombrar service-worker.js a .js.erb para habilitar ERB
- Helper current_store disponible para Rails::PwaController
@JuanVqz JuanVqz force-pushed the demo4-multi-store branch from 1cf27f7 to d00a050 Compare April 13, 2026 20:29
@JuanVqz JuanVqz force-pushed the demo3-cache-strategies branch from 8f67218 to b5129c4 Compare April 13, 2026 20:29
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