catapult-project / catapult

Deprecated Catapult GitHub. Please instead use http://crbug.com "Speed>Benchmarks" component for bugs and https://chromium.googlesource.com/catapult for downloading and editing source code..
https://chromium.googlesource.com/catapult
BSD 3-Clause "New" or "Revised" License
1.93k stars 563 forks source link

What breaks if HTML Imports are removed? #4449

Open pmeenan opened 6 years ago

pmeenan commented 6 years ago

HTML Imports are already deprecated and are on the path to being removed. Most of the web that depends on them falls back gracefully using the webcomponents polyfill for browsers that don't support imports (and does it nicely through feature detection). A lot of the catapult infrastructure assumes Chrome and looks like it makes heavy use of imports (through polymer).

Does tracing and the rest of the catapult infrastructure polyfill imports when they are missing or is it going to break?

Some quick testing with --disable-blink-features=HTMLImports in the current canary seems like the in-browser UI for tracing works ok so maybe it's a non-issue but it would be good to have someone confirm.

simonhatch commented 6 years ago

@benshayden

Can't speak for tracing, I'm pretty sure we use the polyfill on the dashboard.

benshayden commented 6 years ago

Thanks for filing this, @pmeenan ! Is there a hard deadline?

Pinpoint uses html imports in production. @dave-2 Are you planning to vulcanize pinpoint?

Trace viewer and V2SPA vulcanize in production, but use html imports in the browser in their respective dev environments (dev_appserver.py for V2SPA, ./bin/run_dev_server for trace viewer). I forget whether they use the polyfill. I'll test those dev environments with --disable-blink-features=HTMLImports and update this bug if they need to change. Polymer modulizer might help convert dom-module tags to Polymer 3.0 template() methods if necessary, or V2SPA might consider switching to something like lit-html.

Perfetto plans to replace trace viewer in about a year. I'll make sure they're aware of this issue.

dave-2 commented 6 years ago

We don't have plans to vulcanize Pinpoint at the moment. I'll want to sync with the larger Chrome Ops team to learn their deployment best practices, but maybe not for a quarter or two. We do use the webcomponents polyfill, and will eventually migrate to Polymer 3.0 and ES6 modules.

benshayden commented 6 years ago

All catapult's html tests, trace viewer dev server, and v2spa_dev.yaml break with --disable-blink-features=HTMLImports. We might be able to do without dev trace viewer, and v2spa can migrate to polymer3, but we need to fix the html tests before html imports is removed from blink. I tried using webcomponentsjs/HTMLImports.js, and it did load the scripts from imports, but it doesn't add the imported HTML to the dom: the tracing test framework failed to find a template element. I tried upgrading webcomponentsjs to see if a newer version fixed the problem, but the current version is required by Polymer1. Maybe somebody could try to make it add the imported html to the dom? I'm not sure what else we can try aside from upgrading trace viewer to polymer3, which would be a job.