-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix: Firefox Hot reload #934
base: main
Are you sure you want to change the base?
Conversation
@jeromelaban is there a way to use this fix locally? |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-934.eastus2.1.azurestaticapps.net |
Marking as draft, did some local test and I believe there's more to do |
@ajpinedam it's testable using the staging site. It shows this: |
Thanks. Yes that's the error I saw while testing using a demo local script. We will need to add a build rule so that the unoConfig.ts also creates a non-module version of the file.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-934.eastus2.1.azurestaticapps.net |
To avoid making crazy changes that could break other things, I pushed a change to create a duplicate uno-config js using traditional JS instead of a module, removing the need to use |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-934.eastus2.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-934.eastus2.1.azurestaticapps.net |
Firefox was working, but Edge and Chrome stopped. This new change separates the logic between module and classic registration using a fallback since the browser API does not provide a way to know if the module registration is available (w3c/ServiceWorker#1582). So we will try to register with module, edge, and chrome will pass, and if that fails, we will fall back to register with classic; this is the case for Firefox. With this only Firefox will see a little performance hit since we will try register twice.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-934.eastus2.1.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-934.eastus2.1.azurestaticapps.net |
closes https://github.com/unoplatform/private/issues/511
This PR fixes Hot Reload on Firefox by replacing the ES6 module import on the service-worker.js file. This functionality is not supported on Firefox yet.