Skip to content
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

Merged
merged 5 commits into from
Jul 1, 2024

Conversation

santiagorodriguez96
Copy link
Collaborator

Hay un issue con la gema serviceworker-rails que no anda con rack 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 y serviceworker.js) de la misma forma que se hará en Rails 7.2.

@@ -1,5 +0,0 @@
if (navigator.serviceWorker) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/serviceworker.js', { scope: './' })
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

"short_name": "MiCarrera",
"icons": [
{
"src": "<%= asset_path('icon-192.png') %>",
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Buen punto!

@santiagorodriguez96 santiagorodriguez96 merged commit c058028 into master Jul 1, 2024
1 check passed
@santiagorodriguez96 santiagorodriguez96 deleted the sr--remove-serviceworker-gem branch July 1, 2024 12:07
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.

None yet

2 participants