Open heruan opened 6 years ago
Oh, are we importing that by default in our Material theme? Seems risky. I would avoid that, and leave as an option for the developer.
Any update on this? Still causes major trouble for apps without internet access, event when not using Material (why so?).
We could use this dependency: https://github.com/choffmeister/roboto-fontface-bower
Still not clear to me why the browser makes that request even if I'm not using the Material theme.
Yes that's weird. Can you reproduce this without Flow, using web component only?
@heruan does it fix the problem if you exclude the maven dependency?
<groupId>com.vaadin</groupId>
<artifactId>vaadin-material-theme</artifactId>
Turns out this is happening only when bundling the Flow app for production: the unused files are loaded from the bundle. In development mode it doesn't happen.
Yeah, IIRC the Flow bundler scans for all the HtmlImports
it finds in the classpath and adds them to the main bundle. So AFAIK the easiest way to exclude a non-used html-file is to exclude the maven dependency that imports it. Maybe it's also possible by moving the non-used imports into a separate fragment.
Reopened and moved to the monorepo, as the original PR https://github.com/vaadin/vaadin-material-styles/pull/78 was never released 😞
Solution proposal:
css
tagged literals using rollup-plugin-lit-css
It took me a while to catch this, but debugging a slow page load I've found the cause to be this line in
typography.html
:If a Vaadin app is used without Internet access or behind a captive portal, an external dependency like this might slow down page load or even throw errors.
P.S. I'm not even using
vaadin-material-styles
, but somehow it comes along with other dependencies via Flow webjars.