-
Notifications
You must be signed in to change notification settings - Fork 2k
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
importHref should load imports asynchronously #3113
Comments
Can you provide a repro of how the layout "flashes" when a sync import is added to the document? It doesn't make sense that a sync import would cause fouc and that making it async would fix it, without there being some sort of underlying Chrome bug, so it's worth understanding what you're actually seeing. |
Sure. Here are some examples. Sync load (flash): Sync load (watch for flash after spinner stops): Async load (no flash. elements fade in when they're upgraded): Test app (run in canary so you dont need to babel):
Serve up binding.html. It won't produce a flash.
Not sure what's going on here. It may be something with stylesheets/styles in imports getting added to the main document and causing layout/recalc styles. That's my hunch, but I haven't bee able to pinpoint it. FWIW, Both of these apps also use paper-drawer-panel. |
Reproduced the blinking issue down to an apparent chrome bug related to async imports, filed here: https://code.google.com/p/chromium/issues/detail?id=564758 |
@kevinpschaaf Your link results in a 403. |
It's restricted, internal for some reason. |
@JeremybellEU Sorry, should be unrestricted now. |
👍 |
Default will be sync, but we're adding the optional 4th arg for async :) |
importHref loads imports, async. Fixes #3113
Polymer.Base.importHref
doesn't load imports asynchronously. In apps, this can cause layout flashes as the import is added to the DOM and loads. I've witnessed this on a couple of apps were we're usingimportHref
to dynamically load bundles, asynchronously.Instead, loading it with the
async
attr take it out of rendering and solves the issue.The text was updated successfully, but these errors were encountered: