-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Minify ha-style/Roboto and load asynchronously #18226
Conversation
cast/src/receiver/second-load.ts
Outdated
import "./layout/hc-lovelace"; | ||
|
||
import("../../../src/resources/ha-style"); |
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.
this entire module is already dynamically loaded
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.
So just remove the import here? Was the static import a mistake?
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.
I mean second-load.ts
is already loaded dynamic, so we don't need to load ha-style
dynamic too then?
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.
Oh... yeah probably not, although it might end up creating 2 chunks. I'll check real quick.
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.
I took what I think is a better approach and just removed this module, and instead loaded both in hc-main
. That way they are loaded in parallel and the bundle is slightly smaller.
Proposed change
This aims to make some incremental improvements regarding the main light DOM styles:
custom-style
, which I don't believe is applicable anymorecss
tag on the templates so they are linted and minifiedha-style
(no need for 2 DOM operations)Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: