-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Borrar la dependencia de serviceworker-rails
#492
Conversation
@@ -1,5 +0,0 @@ | |||
if (navigator.serviceWorker) { | |||
window.addEventListener('load', () => { | |||
navigator.serviceWorker.register('/serviceworker.js', { scope: './' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tendriamos que hacer unregister
del service worker q los usuarios tengan instalado?
o no es necesario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fijate lo que hice en 663ec44
app/views/pwa/manifest.json.erb
Outdated
"short_name": "MiCarrera", | ||
"icons": [ | ||
{ | ||
"src": "<%= asset_path('icon-192.png') %>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
por lo que veo, lo que hay en este momento en Rails 7.2 genera un archivo que no tiene nada dinámico (el <%= camelized %>
creo que lo remplaza cuando procesa el template (.tt)).
Si es así, y esto es un archivo estático, no se puede servir desde la carpeta public/
como un asset estático?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Buen punto!
Hay un issue con la gema
serviceworker-rails
que no anda conrack
v3.1
. El último commit en el repo fue hace cuatro años.Este PR saca la dependencia de
serviceworker-rails
y en su lugar añade un controlador para servir los archivos necesarios para levantar una PWA (manfiest.json
yserviceworker.js
) de la misma forma que se hará en Rails 7.2.