Web Components with Polymer Jeff Tapper Digital

Slides:



Advertisements
Similar presentations
HTML Basics Customizing your site using the basics of HTML.
Advertisements

Intro to HTML Kin 260 Jackie Kiwata.
Modifying existing content Adding/Removing content on a page using jQuery.
Cascading Style Sheets Understanding styles. The term cascading describe the capability of a local style to override a general style. CSS applies style.
The DataFlex Web Framework Changing the Game Stephen W. Meeley Development Team Data Access Worldwide
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
JavaServer Pages TM Introduce by
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
JQuery CS 268. What is jQuery? From their web site:
Chapter 1 Variables in the Web Design Environment
Web page - A Web page is a simple text file that contains HTML tags (code) that describe what should be displayed on the browser. -The Web browser interprets.
ASP.NET AJAX. Content ASP.NET AJAX Ajax Control Toolkit Muzaffer DOĞAN - Anadolu University2.
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
JQuery Page Slider. Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site.
Build a Free Website1 Build A Website For Free 2 ND Edition By Mark Bell.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
Styling and theming Build campaigns in style. What we'll look at... How a web document is structured How HTML and CSS fit together Tools you will need.
Review IDIA 619 Spring 2013 Bridget M. Blodgett. HTML A basic HTML document looks like this: Sample page Sample page This is a simple sample. HTML user.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Editing for the Web TECM 4190 Dr. Lam. What makes a website “good” Write down some characteristics that you consider define a “good” website.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
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.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
Animation & Effects Using JQuery. What is jQuery? jQuery is a lightweight, JavaScript library. The purpose of jQuery is to make it much easier to use.
Unleash the Power of jQuery Doncho Minkov Telerik Software Academy academy.telerik.com Senior Technical Trainer
UPLOAD / DOWNLOAD april  HTML5 is just the next iteration of HTML  Previous version was technically HTML 4.01, which incorporated XHTML 1.0.
A Look at HTML (and XHTML). Types of Web Applications.
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.
HTML A brief introduction HTML1. HTML, what is? HTML is a markup language for describing web documents (web pages). HTML stands for Hyper Text Markup.
Unit 13 –JQuery Basics Instructor: Brent Presley.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
4. Events are where it happens! Bear Bibeault Yehuda Katz.
CSS Positioning & Layout Creating layouts and controlling elements.
Changing HTML Attributes each() function Anonymous Functions $(this) keyword.
Web Components Polymer. Agenda I want bootstrap : 3 Today.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
François Briard GS-AIS-HR Database Developers Forum, APEX 6th May 2014 APEX Mobile Application Development 101.
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks and.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
HTML5 SEMANTICS TO OR NOT TO THAT IS THE QUESTION BY WILLIAM MURRAY.
Flux & React Web Application Development Mark Repka, Rich McNeary, Steve Mueller.
DYNAMIC FAQ AND DOCUMENTATION PAGES IN SHAREPOINT A modern, reusable, and easy-to-use model.
Best Web Technologies for
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Using Browser-Based Web Developer Tools Learn some of the tricks that developers use to work with HTML, CSS styles, and Javascript.
The HTML5 logo was introduced by W3C in 2010
Intro to JavaScript CS 1150 Spring 2017.
Creating a Baseline Grid
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
Introduction to JavaScript
.NET and .NET Core 7. XAML Pan Wuming 2017.
A second look at JavaScript
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
Introduction to Web Page Design
JQuery with ASP.NET.
Introduction to JavaScript
Modern web applications
Modern web applications
Unit 6 part 3 Test Javascript Test.
Teaching slides Chapter 6.
An introduction to jQuery
Introduction to JavaScript
Introduction to Web Application Design
Bootstrap Direct quote from source: bootstrap/
Presentation transcript:

Web Components with Polymer Jeff Tapper Digital

Who am I? Senior Consultant at Digital Primates – Building next generation client applications Developing Internet applications for 20 years Author of 12 books on Internet technologies

Who are you? ?

What are Web Components? Web Components are an attempt to let you write custom components that can be used like this: Sales:

How do they work Web Components are a combination of several w3c specifications Custom Elements Templates Shadow Dom HTML Imports

Creating Custom Elements Pure JavaScript X-tags: framework developed by Mozilla Polymer: framework developed by Google Each provides lifecycle events you can use

Creating in JavaScript var proto = Object.create(HTMLElement.prototype); proto.createdCallback = function (){ this.textContent = 'This is my tag'; }; document.register('my-tag',{prototype:proto});

Component Lifecycle createdCallback() attachedCallback() detachedCallback() attributeChangedCallback()

X-tags xtag.register('x-frankenstein', { lifecycle:{ created: function(){ alert("Look! It's moving. It's alive!"); } });

Xtags Lifecycle Events created inserted removed attributeChanged

Polymer Polymer('say-hi',{ whatToSay: 'Hi', created: function(){ // do something } })

Polymer Lifecycle Events created attached detached attributeChanged

What is Polymer? A library built on top of Web Components. Allows us to use Web Components today in modern browsers which don’t yet support Web Components 3 main pieces A set of polyfills Web application framework Set of UI components

What are we covering? Web Components, specifically: What in the world are web components? What problem are they trying to solve? How do they work? Can I actually use these things? What does it mean to my app/development process?

Life on the Edge Web Components are beyond leading edge. As of this moment, they do not work in their entirety in all browsers A good portion of the functionality is available in Chrome

So, is it real? Yes!!! Web Component support is actually here today. Even though they are not fully supported in all browsers, Polymer and Polyfills allow use in most modern browsers today

Where can I use this today?

Always finding the latest and greatest componentized-yet/

Why are they important? A few minor reasons you may like the idea, first: Encapsulation Manageable Reuse Hiding complexity and implementation Dealing with duplicated IDs Dealing with CSS scoping / propagation Ease of Distribution Appropriate technology choices Markup in markup, not in code

How do they work? Web Components are a series of Working draft specifications: HTML Templates – Shadow DOM – Custom Elements – HTML Imports –

Example Application Twitter-button created by Zeno Rocha source code available at Language Application created by Michael Labriola

Templates The concept of templates is prolific and nearly self- explanatory. Their use takes a bit more effort: Inactive DOM Fragment Easily Clone-able Easily Change-able

Templates You define them with the template element This is parsed but it’s not active. It’s not rendered.

Shadow DOM Shadow DOM is at the heart of the whole component concepts It’s encapsulation Its used by the browsers today to implement their own controls Ultimately its about hiding implementation details and exposing an interface

Shadow DOM The name and the technical explanation sometimes get in the way of the concept. Put simply, the user sees this: Photo by Photo by: Mark Kaelin/TechRepublic

Shadow DOM The browser sees this: Photo by Photo by: Mark Kaelin/TechRepublic

Shadow Host/Root

Rendering

The Shadow also forms a boundary. Styles don’t cross unless you let them. So you to keep control of this area Styles

This, by default, goes both ways… meaning we aren’t worried about collisions. Styles Outside styles don’t affect shadow content Styles defined in here are scoped locally

HTML Imports HTML imports are about importing and sharing HTML content. Why? Well, reuse, it facilitates the reuse of templates and provides us a fundamental need if we are going to share an encapsulated chunk we might call a component.

HTML Imports Last word on this… Imports aren’t supported pretty much anywhere yet, however, there are polyfills. Imports are blocking. So, your page will act as though it needs this content before it can render.

Custom Elements Elements are the key to putting this together. Custom Elements are DOM elements that can be defined by a developer. They are allowed to manage state and provide a scriptable interface. In other words, they are the shell of what will become our component

Custom Elements Defining a custom element like this: Allows you to use that custom element in your own markup:

Custom Elements You can use the concepts we previously discussed, templates, Shadow DOM, etc. from within a custom element. Further, custom elements give you a set of Lifecycle callbacks so you can know things like when you are inserted into the DOM, removed and ready. This means you can define the visual aspects of a custom element in mark up and the code in script.

Resources – officical twitter of the