Polymer a framework for the evolving web. What is Polymer? New type of library for the evolving web o goal: support latest version of modern browserssupport.

Slides:



Advertisements
Similar presentations
CT-376 jQuery Most popular javascript library today Latest version:
Advertisements

Pemrograman Teknologi Internet W09: DOM & DHTML. 2 Objectives DOM: DOM: DOM Nodes & Trees DOM Nodes & Trees Traversing & Modifying DOM Trees Traversing.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Wireless: WDDPublic Follow along with the code: (or download the Join Me app.
By Gyan Deo Singh Building Rich Web UI with the Microsoft AJAX Library, Extensions, and Toolkit.
AJAX & By – Anupama Sharma. Defining Ajax Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together.
Building Silverlight Applications Using the MVVM pattern An Introduction by Peter Messenger Senior Developer – Qmastor
Enterprise Collaboration Strategist Author, Blogger, Speaker.
BACS 287 Basics of Object-Oriented Programming 1.
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
 jQuery Mobile An Introduction. What is jQuery Mobile  A framework built on top of jQuery, used for creating mobile web applications  Designed to make.
What Are My Choices for Building a Modern Web UI?
CHASING THE EVOLVING WEB Aaron Readify Senior Developer, Technical Specialist (Web) Microsoft MVP – Internet Explorer (Development) SESSION.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
SUNY Polytechnic Institute CS 490 – Web Design, AJAX, jQueryAngularJS AngularJS is a client-side JavaScript Framework for adding interactivity to HTML.
Ajax Runtime Toolkits IBM Emerging Technologies. What is an AJAX Toolkit/Framework? An AJAX Toolkit/Runtime is more than just XMLHTTPRequest Should includes:
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
Introducing NativeScript [Pavel Kolev Software Telerik: a Progress company]
CSS/Photoshop Layouts – Quiz #7 Lecture Code:
ITCS 6010 SALT. Speech Application Language Tags (SALT) Speech interface markup language Extension of HTML and other markup languages Adds speech and.
WEB 304 An Overview of ASP.NET and Windows Workflow Foundation Kashif Alam Program Manager Developer Division Microsoft Corporation.
@ScotHillier Web Parts Workflows Pages Libraries App Parts SharePoint-Hosted Apps Provider-Hosted Apps.
JavaScript, Fourth Edition
INTRODUCTION TO HTML5 Using jQuery with HTML5. Introducing jQuery  Although it is not a part of any W3C or WHATWG specification, jQuery performs an important.
Congratulations! You are part of a global community of thousands of web developers who attend Web Camps to keep their web development skills up-to-date.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
ANGULARJS A Gentle Introduction John /
CSS BEST PRACTICES.
Hattan Shobokshi mvcdotnet.wordpress.com Web Development in the Past (Microsoft Stack)
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
R7 Integrator and Enterprise Integrator: You won’t believe this is XA… Deborah Vermillion, VP Consulting Services, CPIM, CIRM Belinda Daub, Senior Consultant.
+ BackBone.js By. Phil Sheperd. + What is BackBone BackBone is a Javascript Framework How is this different From jQuery or Prototype? Libraries vs Framework.
Windows 10 UWP MVVM In Depth
Welcome to jQuery jQuery is one of many available libraries that – Provide functions for manipulating the web page With fairly good performance – Help.
Kendo Ui Basics.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Web Components with Polymer Jeff Tapper Digital
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Silverlight 101 Ahead! If you know Silverlight and are looking for more advanced content check out : ‘Microsoft Silverlight “Media” : Moving at 60fps’
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
ANGULARJS A Gentle Introduction John Madison.NET User Group.
Web Components Polymer. Agenda I want bootstrap : 3 Today.
Advanced CSS. Display  Hiding an element can be done in two ways  display:none  Element is hidden and will no longer take up space on the page  Can.
Introduction to JavaScript LIS390W1A Web Technologies and Techniques 24 Oct M. Cameron Jones.
Getting Started with Angular 2 and TypeScript Nebraska.Code() 2016 Spencer Schneidenbach Ryvit.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
Bluemix for Domino Developers Niklas Heidloff, heidloff.net.
AngularJS. What is AngularJS  Javascript Framework  MVC  for Rich Web Application Development  by Google.
A Framework for Building Native-Quality HTML5 apps that Run Everywhere Technical School Meet Enyo.
Shanku Niyogi PRS 312 Group Program Manager Microsoft Corporation
JavaScript, Sixth Edition
Building Desktop Apps with Node.js and Electron
Angular 4 + TypeScript Getting Started
AngularJS A Gentle Introduction John
Shanku Niyogi PRS 312 Group Program Manager Microsoft Corporation
Best Angular 2 interview questions and Answer that have been designed for Angular 2 programmers who are preparing online interviews on Angular 2 interviews question. Visit Website:
Building Native Mobile Apps with Angular 2.0 and NativeScript
Jessica Betts, Sophia Pandey, & Ryan Amundson
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
MVC in ASP.NET Core: The new kid on the block
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
Modern web applications
Building responsive apps and sites with HTML5 web workers
Chasing the evolving web
MIX 09 12/8/2018 4:33 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Adaptive Web Components: Context Matters!
Modern web applications
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Polymer a framework for the evolving web

What is Polymer? New type of library for the evolving web o goal: support latest version of modern browserssupport Set of polyfill libraries Web Components are its core Sugaring layer UI Components (in progress)

Philosophy Embrace HTML! o everything is a custom element Leverage the web platform o gets smaller and better over time Minimize boilerplate code o remove tediousness of building web apps o feedback loop to web platform standards Salt to taste o designed to be a la carte

Polymer stack Platform ( platform.js ) ~31KB o polyfills for Shadow DOM, Custom Elements, MDV,... Core ( polymer.js ) ~37KB o includes platform.js o expresses opinionated way to these new APIs together Polymer / UI elements o in progress...

Web Components

Demos

Key players Shadow DOM HTML Templates o Custom Elements o HTML Imports o

Custom elements define new HTML elements

var SayHello = document.register( 'say-hello', {prototype: proto}); var el = document.createElement(‘say-hello’); // var el = new SayHello(); Registering an element

p { color: orange; } Hello world! Template - "inert" markup

var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function() { var t = document.querySelector(‘template’); var copy = t.content.cloneNode(true); this.createShadowRoot().appendChild(copy); }; document.register('say-hello', {prototype: proto}); Shadow DOM - gives encapsulation

var proto = Object.create(HTMLElement.prototype); proto.sayHi = function() { alert('Hiii!'); }; Object.defineProperty(proto, ‘name’, {value: ‘Eric’}); document.register('say-hello', {prototype: proto}); Define a public API Just like existing DOM elements: var a = new Audio(); a.loop a.muted a.load()

Use today with platform.js document.register(‘say-hello’,...); DEMO

HTML Imports - include definitions

Polymer elements

Polymer elements are custom elements with special sauce

Polymer: Core Includes the polyfills in platform.js

Polymer features Easier element registration Publishing attributes, properties, methods Data binding Automagic change watchers Declarative event-mappings Automatic node finding Element inheritance is a breeze

Easier element registration Hello world! Polymer('say-hello');

Publishing properties/methods Hello world! Polymer('say-hello', {" attributes="name ready: function() {...}, sayHi: function() { alert('Hiii!'); } name: 'Eric' });

Two-way data binding Hello {{name}}! Polymer('say-hello', { name: 'Eric', show: true }); DEMO

Automagic change watchers Hello {{name}}! Polymer('say-hello', { colorChanged: function() { if (!this.color.match(/red|orange|yellow/)) { console.log("Color wasn't hot!"); } }); DEMO

Declarative event-mappings Hello {{name}}! Polymer('say-hello', { doKeyPress: function() { if (this.name.match(/^Larry Page$/i)) { alert('Googler!'); } }); DEMO

Polymer('say-hello', { ready: function() { this.$.myInput.style.color = 'red'; } }); Automatic node finding this.$.

Styling elements

Default { :scope { display: block; background: red; padding: 5px; transition: opacity 400ms; } :scope:hover { opacity: 0.5; } } Polymer('say-hello');

Styling distributed nodes h1 > span */ content::-webkit-distributed(h1 > span) { color: red; } Polymer('say-hello'); Hello Eric! DEMO

Hello {{name}}! Polymer('say-hello'); say-hello::x-myname { color: red; } DEMO Custom pseudo elements provide style hooks for internal elements

Advanced Concepts

Advanced features Element inheritance o extending existing HTML elements Firing custom events Messaging between elements Reusing others' elements o UI-less components

Polymer('polymer-cool', { praise: 'cool', makeCoolest: function() { this.praise = 'coolest'; } }); {{praise}} Polymer('polymer-cooler'); DEMO Element inheritance extends attribute

Extending existing HTML elements... Polymer('super-li');...

Polymer('say-hello', { clickHandler: function() { this.fire('said-hello', {name: this.name}); } }); document.body.addEventListener('said-hello', function(e) { console.log(e.type, 'to', e.detail.name); // "said-hello to Eric" }); DEMO Sending custom events this.fire() Just a wrapper for new CustomEvent()

"Messaging" between elements Pick your poison: 1.Data-binding - two-way via attributes 2.API - calling an element's public methods 3.Events - firing custom events

Polymer('say-hello', { restoreName: function(e, detail, sender) { this.name = 'John Doe'; } }); DEMO Communication using published properties

Polymer('say-hello', { restoreName: function() { this.name = 'John Doe'; } }); Restore document.querySelector('button').addEventListener('click', function(e) { document.querySelector('say-hello').restoreName(); }); Communication: calling public API methods

... Polymer('say-hello', { sayHi: function() { alert('Hiiya!'); this.fire('saidhello', {name: this.name}); } }); Communication: fire custom events (pub/sub) Polymer('my-app', { sayBye: function() { alert('kthxbye!'); }, hiDone: function(e, detail, sender) { alert('Said hi to ' + detail.name + ' from ' + sender.localName); } }); DEMO Event bubbling! "Hiiya!" "Said hi to Eric from say-hello" "kthxbye!"

Reusing others' elements Two Three Polymer('my-menu');

... <polymer-jsonp url=" auto response="{{data}}">... Polymer('my-menu', { dataChanged: function() {...} }); UI-less components custom elements don't have to have UI! CODE

polymer-project.org