7. Chrome version 43
// Check for Geolocation API permissions
navigator
.permissions.query({name:’geolocation’})
.then(function(permissionStatus)
{
console.log('permission status is ',
permissionStatus.status);
permissionStatus.onchange = function() {
console.log('permission has changed to ',
this.status);
};
});
49. Web Components
HTML Imports
Custom elements
Template
Shadow DOM
컴포넌트 로딩
엘리먼트 등록
마크업 구조화/생성
스타일과 DOM을 보호
Visit to read in detail: http://goo.gl/aiEI6F
57. Slide from “Polymer and modern web APIs: In production at Google scale"
0
150
300
450
600
Time
0
750
1500
2250
3000
Time
mobile safari
4x FASTER
Chrome
3x FASTER
58. Slide from “Polymer and modern web APIs: In production at Google scale"
0.51.0
35% LESS CODE
42kb19kb -
59. Slide from “Polymer and modern web APIs: In production at Google scale"
1.0 Features
Shady DOM
Theming with CSS custom prop.
60. Slide from “Polymer and modern web APIs: In production at Google scale"
Existing Frameworks
Applications
Web Platform
Web Components Built with Polymer (or not)
87. <!-- route controller -->
<santa-router route="{{route}}" autoHash></santa-router>
<!-- scenes elements are upgraded on demand -->
<lazy-pages selected=“{{route}}” selectedItem=“{{selectedScene}}”
valueattr=“route”>
<!-- scenes elements inherit from base-scene.html -->
<village-scene route=“village" path=“scenes/village_{{lang}}.html” hidden>…
<!-- scenes can specify their own loading image & background -->
<santaselfie-scene route="santaselfie"
path=“scenes/santaselfie-{{lang}}.html”
loadingBgColor="#83D7F5"
loadingSrc=“scenes/selfie_loading.svg” hidden>…
</lazy-pages>
<santa-app>
</santa-app>
Slide from “Polymer and modern web APIs: In production at Google scale"
88. <!-- route controller -->
<santa-router route="{{route}}" autoHash></santa-router>
<!-- scenes elements are upgraded on demand -->
<lazy-pages selected=“{{route}}” selectedItem=“{{selectedScene}}”
valueattr=“route”>
<!-- scenes elements inherit from base-scene.html -->
<village-scene route=“village" path=“scenes/village_{{lang}}.html” hidden>…
<!-- scenes can specify their own loading image & background -->
<santaselfie-scene route="santaselfie"
path=“scenes/santaselfie-{{lang}}.html”
loadingBgColor="#83D7F5"
loadingSrc=“scenes/selfie_loading.svg” hidden>…
</lazy-pages>
<santa-app>
</santa-app>
Slide from “Polymer and modern web APIs: In production at Google scale"