Merged
Conversation
4 tasks
Merged
Member
|
@balloob was there any reason for limiting the service worker to only the latest build (other than legacy browsers not supporting them at the time)? |
Member
Author
|
Exactly that. |
Member
|
Okay. I want to fix an issue with its source map, so I'll enable it for legacy while I'm at it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend PR: home-assistant/core#23618
Alright, so I promised myself to no longer refactor the complete build pipeline for the frontend, but it looks like I was wrong 😁 .
Our current build pipeline is build around a few small scripts to generate icons and translations, and the rest is done in Webpack: copying static files, transpilation, bundling, generating service worker, generating HTML entrypoint files.
The Webpack build was executed twice: once for ES5 and once for modern JS. Because the HTML was already diversified, we ended up doing browser sniffing to route browsers to the right version. This did not always work properly, especially with non-mainstream browsers or sometimes just randomly with mainstream browsers.
With this PR, we are going to change this:
asyncandawaitThe development and build commands remain unchanged:
script/developandscript/build_frontend.Feature detection of async
Initially I wanted to follow Rich Harris' suggestion of defining an async function: https://twitter.com/Rich_Harris/status/1092916976383651842 . However, as per the replies, this would generate an error for older browsers. So instead, I used a version of this approach.
Fixes #3023