Hacker News new | ask | show | jobs
by mrisse 4032 days ago
Do web components have a chance when a polyfills are required for iOS? Does anyone have any experience w/ Polymer performance on iOS?
3 comments

Polymer 1.0 uses "Shady DOM" instead of a full shadow DOM polyfill. According to https://www.polymer-project.org/1.0/articles/shadydom.html, "Many projects simply cannot afford the Shadow DOM Polyfill, for the reasons given above. In particular, the performance costs on platforms like mobile Safari are nearly intolerable."

"Polyfilling shadow DOM is hard, the robust polyfill is invasive and slow. Shady DOM is a super-fast shim for shadow DOM that provides tree-scoping, but has drawbacks. Most importantly, one must use the shady DOM APIs to work with scoped trees."

So it sounds like this lighter, less complete Shady DOM half-polyfill that 1.0 uses is specifically made to make performance acceptable on iOS.

Exactly. Performance under iOS is great with Shady DOM, at the expense of needing to use its APIs to get the effects of DOM scoping and composition.
There has been major progress on getting all browser vendors to agree on Shadow DOM. It sounds like the final details will be hammered out soon (this summer) and implementation will start shortly after that.
Getting good performance out of iOS was a major focus for v0.8 - thus the shady dom. They got >5x faster performance: https://blog.polymer-project.org/updates/2015/03/27/why-0.8/