SlideShare a Scribd company logo
CLUB AJAX
by Mike Wilcox, January 2017
Web Components
and ES6 Classes
JS Frameworks
• Some more mobile friendly than others
• Although hard to say that any of them truly are
• Jeff Atwood complains about poor Ember perf for Discourse
• Isomorphic/Universal Apps using server side rendering
• Creates faster visual content on the page
• But also creates a “valley of death” where the page is no functional
• Virtual DOM can sometimes be effective
• Sometimes effective
• Sometimes not
• On demand loading
• Some frameworks support it, some don’t
Web Components v1

Recommended for you

Web Components
Web ComponentsWeb Components
Web Components

Web Components are like Lego bricks. Easy to assemble and every piece simply fits together. But there is even more to it. Being able to create your own HTML-Tags with encapsulated style & logic changes the way you think about structuring your web applications. Get a sneak peek on how to develop scalable & maintainable applications in the future.

htmlcssfuture
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components

Presented at Web Unleashed 2017. More info at www.fitc.ca/webu Presented by Ksenija Gogic, TWG Overview What are components? How can designers apply a component-minded approach to their workflow? How can we leverage components to improve the design handoff? Ultimately – how can designers and developers work together even better? Using React as a framework, Ksenija will discuss how to design for a component-based web application to make for a more efficient workflow, an easier design handoff, and a better understanding between roles. Objective To create a common language and understanding when working with component-based web frameworks between designers and developers. Target Audience Designers and developers looking to make their collaborative workflow even better. Five Things Audience Members Will Learn How to take a component-minded approach to building a design system How to design and create components using Sketch symbols How to assemble (compose) collections of components using Sketch symbols How to work with modifiers (props) to customize components How to ensure everyone is speaking the same language

 
by FITC
web designweb developmentweb unleashed 2017
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components

Web Components allow developers to build reusable custom elements that encapsulate HTML, CSS, and JavaScript. They include features like Shadow DOM for encapsulation, templates for stamping out repeated sections, HTML imports for modular code, and custom elements for defining new types of elements. Polymer makes it easy to build web applications using these new web component standards by providing polyfills and a set of pre-built reusable elements.

web componentshtmljavascript
Dojo
Dojo
<div class='createSection' data-dojo-attach-point='createSection'>

<div class='row'>

<div data-dojo-attach-point="filterName"

data-dojo-type="app/components/ui/TextFilter" 

data-dojo-props="fieldLabel:'${messages.filterName}', required:
true”>
Dojo
<div class='field'>

${labelNode}

<div data-dojo-attach-point="textbox" class='fieldWidget'

data-dojo-type="dijit/form/TextBox"

data-dojo-attach-event="onKeyUp: _update"></div>

</div>
define([

'dojo/_base/declare',

'dx/Widget',

'dojo/text!./templates/TextFilter.html',

'dijit/form/TextBox'

], function(declare, Widget, template) {



return declare(Widget, {

templateString: template,

postMixInProperties: function(){ },

postCreate: function(){ },

focus: function(){

this.textbox.focus();

},

_setValueAttr: function(value){

this.textbox.set('value', value);

},



_getValueAttr: function(){

return this.textbox.get('value');

},
Dojo

Recommended for you

HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)

I based my presention on the great "HTML5 for Web designers" by Jeremy Keith. Awesome and pragmatic book, the way I like it. Get your copy on: http://books.alistapart.com/products/html5-for-web-designers

htmlaudiowhatwg
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery Templates

Come and see the future of jQuery Templates, as it moves from Beta1 towards a V1 product. The new jQuery Templates is taking two forms: JsRender – lean and mean, for fast rendering of templates as strings, and JsViews – for powerful interactive browser apps in which Data Link and Templates work hand-in-hand. See how with declarative data linking and templating together, creating powerful data-driven UI is easy, whether using MVVM patterns or binding directly to JSON, and whatever the richness or complexity of the underlying data. jQuery UI is already building its future data-bound widgets on top of this technology. With JsViews and JsRender integration between jQuery UI controls and your own data and UI becomes trivially straightforward.

jquerydata linktemplates
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide

This document provides an agenda and overview for a SharePoint and jQuery event. It discusses what jQuery is and why it is useful for SharePoint. It covers jQuery and SharePoint basics, deployment options, development best practices, and examples of commonly used jQuery methods. The presentation aims to demonstrate how jQuery can be used to modify and enhance the user experience of SharePoint.

jqueryoffice 365javascript
Ember
Ember
<div class="client-page">



{{side-nav nav=navigation clientId=model.client.id}}
Ember
<div class="nav-items">

{{#each nav as |link|}}

{{#unless (eq link.state "hidden") }}

{{#if (eq link.state "disabled") }}

<div class="side-nav-link {{link.state}}">

<div class="side-nav-title">{{link.title}}</div>

</div>

{{else}}

{{#link-to link.route title=link.title class=link.state}}

<div class="side-nav-link {{link.state}}">

<div class="side-nav-title">{{link.title}}</div>

</div>

{{/link-to}}

{{/if}}

{{/unless}}

{{/each}}

</div>
Ember
import Ember from ‘ember';
import Navigation from '../../mixins/navigation';


export default Ember.Component.extend(Navigation, {

classNames: ['side-nav'],

nav: null,
clientId: ‘NA’,
activeNavigation: Ember.computed('navigation', function () {

let activeNavigationObject = [];

this.get('navigation').forEach((mainItem)=> {

...

});

return activeNavigationObject;

}),


});

Recommended for you

The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015

Presentation from Angular Summit Keynote in September 2015. http://angularsummit.com/conference/boston/2015/09/session?id=34212 AngularJS is one of today's hottest JavaScript MVC Frameworks. In this session, we'll explore many concepts it brings to the world of client-side development: dependency injection, directives, filters, routing and two-way data binding. We'll also look at its recommended testing tools and build systems.

angularsummitangularjsjavascript
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can build

From jQuery San Diego, held Feb 12-13 2014, my talk on web accessibility for web developers. I cover basic techniques, introduce screen readers and ARIA, and go over testing. The goal is to demystify accessibility so we can weave it in to applications today.

a11yaccessibilityjquery san diego
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA

Sightly is an HTML templating language used for building templates in AEM. It uses expression language, data attributes, and includes to build templates with dynamic content. Tools like Brackets and Eclipse plugins can be used to develop Sightly templates, which are HTML files that make use of expression language, data attributes, and includes to insert dynamic content. Sightly templates also leverage the WCMUse API to interact with the AEM page manager, properties, and other core features.

adobe aem6
Angular 2
Angular
<div [ngBusy]="{busy: busy, message: 'Please wait...'}">

<div *ngIf="settingView">

<my-actions [links]="settingView.actionUrls"></my-actions>

</div>

</div>
Angular
<h4>Actions</h4>

<div class="section">

<a href="{{links[0]}}">Change Your Password</a>

<a href="{{links[1]}}">Change Your Security Questions</a>

<a href="{{links[2]}}">Change other usernames for a Single Sign-
On Experience</a>

</div>
Angular
import { Component, Input, OnInit } from '@angular/core';



@Component({

moduleId: module.id.toString(),

selector: 'my-actions',

templateUrl: 'actions.component.html'

})

export class ActionsComponent implements OnInit {

constructor() { }



@Input()

links: string[] = [];



ngOnInit() { }

}

Recommended for you

Levent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & PolymerLevent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & Polymer

This is in a developer-focused session on developing iOS apps with Web Components and Google Polymer. Web Components usher in a new era of web development based on encapsulated and interoperable custom elements that extend HTML itself. Built atop these new standards, Polymer makes it easier and faster to create anything from a button to a complete application across desktop, mobile, and beyond.

What is jQuery?
What is jQuery?What is jQuery?
What is jQuery?

jQuery is a fast, light-weight, and feature-rich JavaScript library. The main purpose of jQuery is t...

slider jqueryjquery downloadjquery plugins
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise

Last year, AOL adopted a new content strategy and has positioned itself as a premier destination for original content. Core to this strategy is having reusable, highly efficient and optimized common code and experiences at scale, which is where jQuery comes in. Check in with Dave Artz to see how jQuery has helped his front-end standards team tackle unique challenges like optimizing 3rd party widget performance, overriding plugin functionality, and managing dependencies and updates across 100+ sites spanning multiple back-end platforms.

jquery javascript jscon jqcon webdesign webdevelop
React
React
import React from 'react';

import { render } from 'react-dom';

import Text from './form-sections/text';

export default class Form extends React.Component {

constructor(props) {

super(props);

}

render() {

return ( 

<ay-form ref="form">

<Text />

</ay-form> 

);

}

}

React
import React from 'react';

import { render } from 'react-dom';

import pure from 'react-addons-pure-render-mixin';



export default class Text extends React.Component {

constructor(props) {

super(props);

this.shouldComponentUpdate = pure.shouldComponentUpdate.bind(this);

}

render() {

return (

<section>

<ay-field type="text" value="" name="where"
placeholder="Where"></ay-field>

</section>

);

}

}
jQuery

Recommended for you

Web Components + Backbone: a Game-Changing Combination
Web Components + Backbone: a Game-Changing CombinationWeb Components + Backbone: a Game-Changing Combination
Web Components + Backbone: a Game-Changing Combination

Web Components promise to change how we think about modularity on the web, and when combined with the structure and organization of Backbone.js we can create portable, dynamic, encapsulated UI modules that fit into any web application.

backbone.jsjavascriptweb components
HTML5와 오픈소스 기반의 Web Components 기술
HTML5와 오픈소스 기반의 Web Components 기술HTML5와 오픈소스 기반의 Web Components 기술
HTML5와 오픈소스 기반의 Web Components 기술

HTML5 의 표준 권고안이 채택되면서 HTML5는 엄청난 속도로 웹 전반에 걸쳐 보급되고 있습니다. HTML5 와 기존의 HTML4 / XHTML 1.1 과의 가장 큰 차잇점은 웹을 바라보는 관점입니다. 웹브라우저를 저작 플랫폼이 아닌 실행 환경으로 바라보는 HTML5의 독특한 관점은 webcomponent 에 잘 드러나 있습니다. 이 발표에서는 webcomponent 의 개념 및 역사를 훑고, webcomponent 오픈소스 구현체들인 webcomponents.js 및 구글의 Polymer, 모질라의 x-tag 과 함께 페이스북의 React 와의 비교 및 브라우저 대응에 대한 내용을 다룹니다.

web componentshtml5react
[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher

Anatomy of a web app HTML5 CSS3 This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2016. http://www.ivanomalavolta.com

html5css3web apps
React
<div class="jq-picker"></div>

<script>

$.ready(function(){

$(".jq-picker").jqPicker(options);

});

</script>
JS Frameworks + Web Components
• Web Components are “just HTML” so they will work with all of them
• It may require some manual wiring, like using addEventListener
• With plugins, you can make use of framework template functionality
• https://github.com/webcomponents/react-integration
• https://github.com/clubajax/react-inject-change-events
What are they?
Web Components Benefits
• Part of the DOM - lifecycle tools for free!
• Future-proof and cross-browser (web standard) for creating and extending
reusable components.
• Requires no library or framework to get started. Vanilla JS/HTML FTW!
• Provides a familiar programming model. It's just DOM/CSS/HTML.
• Creates a very modular system
• Tightly integrated with the browser's DevTools.
• Leverage existing accessibility features.

Recommended for you

HTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery TrainingHTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery Training

The document provides a 6 day training agenda covering HTML, CSS, JavaScript, and jQuery. Day 1 covers HTML basics, CSS basics and layouts. Day 2 covers HTML forms, CSS styling, and responsive design. Days 3-5 cover JavaScript programming, events, AJAX, and jQuery. Day 6 covers more advanced jQuery topics.

htmlcssajax
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals

An introduction to AngularJS architecture and usage, equipped with an overview of AngularJS role in solving the problems arised along the history of web development. For further material and updates: http://blog.avirancohen.com

javascriptangularjs
Web components - An Introduction
Web components - An IntroductionWeb components - An Introduction
Web components - An Introduction

An introduction to Web Components describes why we should use web components for Web App development and how Polymer Javascript library from Google can help build web components faster.

web components and polymer
Web Components
• Custom Elements
• Shadow DOM
• Templates
• HTML Imports
All four of these items are a WC3 spec, all of which makes up Web Components
Custom Elements
• Define your own element types and functionality
• Provides a standard way to associate JavaScript logic with an
element
• Lifecycle methods
• No confusing context — “this” is the element
• Easy to inspect in debuggers
We could do custom elements with
IE6… the difference is the life cycle
methods
<x-tabs>

<ul>Tab 1</ul>

<ul>Tab 2</ul>

<ul>Tab 3</ul>

</x-tabs>
Shadow DOM
Content can be
“projected” into
provided slots
• Shadow DOM refers to the ability of the browser to include a subtree of
DOM elements into the rendering of a document, but not into the main
document DOM tree.
• CSS style rules are constrained to the shadow tree they were defined in.
• The DOM is also encapsulated. For example,
document.querySelectorAll('div'); will not return any results from a
custom element with Shadow DOM
Templates
• The template element is used to declare fragments of HTML
that can be cloned and inserted in the document by script.
• Contains a DocumentFragment in its
HTMLTemplateElement.content property

Recommended for you

Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived

Stencil provides a compiler that generates standard-compliant custom elements from components written using its API, making it easier to create reusable web components. It addresses problems with vanilla custom elements by adding features like virtual DOM, reactivity, JSX and TypeScript support. Stencil components can be used by any framework since the output is just standard web components, avoiding issues of framework coupling. It also helps create sharable infrastructure components and enables building microfrontends with shared behaviors across applications.

web componentsstenciljs
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework

Apache Wicket is a Java web application framework that uses a component-based programming model to build web UIs, allowing developers to treat page elements like buttons and labels as objects and handle events like clicks. It aims to bridge the gap between desktop and web development by enabling an event-driven programming style and component hierarchy similar to Swing. Wicket pages are composed of reusable Java components that correspond to HTML elements, avoiding the impedance mismatch between Java and HTTP programming models.

wicketjeejava
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]

React FUNdamentals Jarrod Servilla, Daniel Laufer, and Milind Vishnoi on October 27, 2021 Learn the fundamentals of React!

HTML Imports
<link rel=“import” href=“./my-bugger.html” />

<link rel=“import” href=“./my-zapper.html” />
• Can import all in one file: JavaScript, HTML, and CSS
• Effectively, an HTML document.
• HTML Imports can be the dependency management system, replacing
AMD or CommonJS
• HTML Imports let you include and reuse HTML documents in other HTML
documents, just as script tags let you include external JavaScript in their
pages.
HTML Imports - CONS
The HTML Import spec does not
have consensus. Mozilla is still
holding out, after two years.
<link rel=“import” href=“./my-bugger.html” />

<link rel=“import” href=“./my-zapper.html” />
• Confusing context when importing templates
• Spec essentially competes with ES modules
• Globals
Can I use…?
Browser Support
• Chrome v54
• WebKit Nightly v18
• Edge has begun prototyping
• Firefox has an open bug

Recommended for you

Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived

This document discusses how Stencil can help solve problems with creating custom web components. Stencil is a compiler that generates standard-compliant web components from components written with features like JSX and TypeScript. It addresses issues like verbose syntax and lack of framework features by generating code that includes capabilities like virtual DOM and reactivity. Stencil works at build time so generated components can be used by any framework and are suitable for building reusable infrastructure components.

stenciljsjavascriptweb components
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!

This document discusses integrating Django, Django Rest Framework, React, Redux, and related technologies. It recommends using Webpack to bundle JavaScript assets. It provides code examples for defining React components, Redux reducers, and connecting a React frontend to a Django Rest Framework backend via API calls. The document emphasizes building reusable presentational and container components, and wiring actions and reducers to the backend via Redux middleware like redux-promise.

djangoreactjs react webpack redux javascript
Internet protocol second unit IIPPT.pptx
Internet protocol second unit IIPPT.pptxInternet protocol second unit IIPPT.pptx
Internet protocol second unit IIPPT.pptx

IP

ip
Browser Stats
We need to support old IE because we…
• want to expose our servers to unsupported, insecure browsers.
• like to pay the extra IE development cost (8:25%, 9:10%, 10:5%).
• enjoy tying up QA to spend extra time testing more browser versions
https://www.xfive.co/blog/stop-supporting-ie10-ie9-ie8/
Seriously, management often encourages
the support of old versions because they
are not aware of the cost and risk.
Polyfills
• A polyfill for HTML Custom Elements.
• ShadyDOM provides a shim for ShadowDOM V1. It is less correct but less
intrusive and faster than the ShadowDOM Polyfill.
• ShadyCSS provides a shim for CSS Custom Properties, CSS Mixins with
@apply support, and ShadowDOM V1 style encapsulation with the ShadyDOM
library.
v0 vs v1*
*The differences between the old spec and the recent changes

Recommended for you

WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...

This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.

sammyjshtml5javascript
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado

Tornado is a Python web framework and asynchronous networking library. It is a scalable, non-blocking web server that allows applications to handle multiple requests simultaneously using a single thread. Some key features include lightweight and fast templates, asynchronous request handlers, and integrations with databases, caches and other services. Tornado is best suited for building real-time web services and can be used alongside other front-end web servers.

web application developmentpythontornado
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...

Lightning Web Components are custom HTML elements built using HTML and JavaScript. This document discusses the fundamentals of Lightning Web Components including their structure, templating, lifecycle hooks, communication between components, and provides a recipe for building a basic to-do list app as an example. The recipe demonstrates creating the necessary SFDX project and components, defining the component templates and logic, and adding the main application component to display the to-do form.

#lwc #events #decorators#webstack#component-lifecycle
v0
var proto = Object.create(HTMLElement.prototype);

proto.createdCallback = function() {

// invoked on creation

};

proto.attachedCallback = function() {

// invoked when added to the document

};

proto.detachedCallback = function() {

// invoked when removed from the document

};

proto.attributeChangedCallback = function(attrName, oldVal, newVal) {

// invoked when an attribute is changed

};


var MyComponent = document.registerElement('my-component', {

prototype: proto

});
class MyComponent extends HTMLElement {

static get observedAttributes() {
return ['value', 'disabled'];
}

constructor ( ) {

super();

}

connectedCallback ( ) { }

disconnectedCallback ( ) { }

attributeChangedCallback(attrName, oldVal, newVal) { }

adoptedCallback() { }

}

customElements.define('my-component', MyComponent);
v1
constructor: the element is
created or upgraded
connectedCallback: the
element is inserted into the DOM
disconnectedCallback: the
element is removed from the DOM.
attributeChangedCallback:
an attribute was added, removed,
or updated
adoptedCallback the element
has been moved into a new
document
define: exposes the element
name for use in markup
History
Q: Why did the spec change?
A: The old spec did not work with ES6 classes
Q: Does the new spec work wth ES5?
A: uh, sort of…
Q: Who changed it?
A: Blame Apple's Ryosuke Niwa. He’s made a few changes…
Q: Should I wait to use Web Components until v1 is implemented?
A: No, not any more than you would wait for any other shim-able browser feature
Inheritance
class MyButton extends HTMLButtonElement {

constructor () {

super(...arguments);

}

}

customElements.define('my-button', MyButton, {extends: 'button'});
Extends something other than
HTMLElement
Extra argument when defining
Blocked by Apple.
Use native tag, and extended
tag in “is”
This is what it would look like… if it were implemented.

Recommended for you

MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour

This document provides an overview of ASP.NET MVC including its history, the MVC pattern, controllers, views, routing, and Razor views. It discusses the Model-View-Controller components, controller actions, action results, and action filters. It also covers view helpers, layouts, sections, and Razor syntax features.

Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...

This document provides an overview and agenda for an advanced SharePoint 2010 and 2013 web part development session. The agenda includes discussions on visual web parts, persistent web part properties, editor parts, connectable web parts, web part verbs, asynchronous web parts, the web part gallery, and web part pages. It also includes demos of these various web part features. The presenter is introduced as a senior SharePoint architect and Microsoft MVP with experience in web part and SharePoint development.

sptechcon
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia

1) The document discusses how to build modular web applications using the JavaScript frameworks Backbone.js and RequireJS. It advocates separating an application into reusable components using the Model-View-Controller (MVC) pattern and composing the interface from independent views. 2) RequireJS allows code to be split into bite-sized modules and defines dependencies between modules. This supports large-scale application development and avoids dependency issues. 3) The document provides an example of a fictitious stock trading application called Bullsfirst that demonstrates these techniques and emphasizes the importance of architecture for engaging web applications.

ES6 Classes
class MyComponent extends HTMLElement {

static something () { return 'something'; }

constructor () {

super();

}

connectedCallback () {

//

}

}
always call super() first in the
constructor. “this” is not established until
after
Commas are forbidden to emphasize that
class definitions are different from object
literals.
Classes are sugar for prototypal inheritance. MyComponent is a function that
inherits from the HTMLElement prototype.
static is similar to:
MyComponent.something = function () {
return ’something’;
}
data properties are not allowed like in objects:
{a: true} (yet)
getters and setters must be used.
super is used as a function in the
constructor, as property references:
super.someMethod();
Custom Element API Considerations
• Sync important properties with attributes
• getters/setters over methods
• Broadcast changes via events
• Use standard properties and event names (“value”, “change”)
• innerHTML — what happens, before and after initialization?
• Appending children
• Use :defined or alternative
• Consider Shadow DOM styling pros and cons
DEMOS
Refs
https://github.com/webcomponents/shadydom
https://github.com/webcomponents/shadycss
https://webkit.org/blog/7027/introducing-custom-elements/
https://github.com/webcomponents/react-integration
https://github.com/clubajax/react-inject-change-events
https://hacks.mozilla.org/2014/12/mozilla-and-web-components/
https://www.polymer-project.org/1.0/blog/2016-12-21-polymer-2.0-update
https://developers.google.com/web/fundamentals/getting-started/primers/customelements?hl=en#historysupport
https://twitter.com/AaronGustafson/status/717028669948977153
https://github.com/w3c/webcomponents/issues/509

Recommended for you

Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery

Javascript and first-class citizenry: require.js & node.js Javascript on web pages is ubiquitous and its problems are legendary. Javascript, seen as a second-class code citizen, is usually hacked together even by seasoned developers. New libraries (jQuery, prototype, backbone, knockout, underscore) and runtime tools (firebug, jasmine) look like they solve many problems - and they do. But they still leave poorly written code as just that. One key problem is that all javascript code lives globally and this results in poorly managed, tested and delivered code. In this session, I will illustrate that we can treat javascript as a first-class citizen using with require.js and node.js: it can be modular, encapsulated and easily unit tested and added to continuous integration cycle. The dependencies between javascript modules can also be managed and packaged just like in C# and Java. In the end, we can resolve many javascript difficulties at compile time rather than waiting until runtime.

javascript requirejs node.js
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint

This document provides an overview of using jQuery in SharePoint. It discusses what jQuery is, why it is useful for SharePoint development, and how to deploy and develop with jQuery in SharePoint. It provides examples of common jQuery methods and best practices. It also demonstrates using the jQuery UI library to add tabs to a page.

sharepointjqueryoffice 365
Voorhoede - Front-end architecture
Voorhoede - Front-end architectureVoorhoede - Front-end architecture
Voorhoede - Front-end architecture

Presented during Javascript MVC Amsterdam meetup, 29 Jan 2014: http://www.meetup.com/JavaScript-MVC-Meetup-Amsterdam/events/156767102/ At De Voorhoede (http://voorhoede.nl) I'm responsible for setting up new front-end projects in such a way that it's easy for teams to work with. This presentation explains how we structure these projects. The presentation includes some tips on structuring larger AngularJS projects.

front-endfrontendbest practice
CLUB AJAX

More Related Content

What's hot

[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS
Ivano Malavolta
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
Ashlimarie
 
Harness jQuery Templates and Data Link
Harness jQuery Templates and Data LinkHarness jQuery Templates and Data Link
Harness jQuery Templates and Data Link
BorisMoore
 
Web Components
Web ComponentsWeb Components
Web Components
Nikolaus Graf
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components
FITC
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
Rich Bradshaw
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
François Massart
 
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery Templates
BorisMoore
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
Mark Rackley
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015
Matt Raible
 
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can build
Monika Piotrowicz
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
Yash Mody
 
Levent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & PolymerLevent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & Polymer
Erik Isaksen
 
What is jQuery?
What is jQuery?What is jQuery?
What is jQuery?
tina3reese7
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
Dave Artz
 
Web Components + Backbone: a Game-Changing Combination
Web Components + Backbone: a Game-Changing CombinationWeb Components + Backbone: a Game-Changing Combination
Web Components + Backbone: a Game-Changing Combination
Andrew Rota
 
HTML5와 오픈소스 기반의 Web Components 기술
HTML5와 오픈소스 기반의 Web Components 기술HTML5와 오픈소스 기반의 Web Components 기술
HTML5와 오픈소스 기반의 Web Components 기술
Jeongkyu Shin
 
[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher
Ivano Malavolta
 
HTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery TrainingHTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery Training
ubshreenath
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
Aviran Cohen
 

What's hot (20)

[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Harness jQuery Templates and Data Link
Harness jQuery Templates and Data LinkHarness jQuery Templates and Data Link
Harness jQuery Templates and Data Link
 
Web Components
Web ComponentsWeb Components
Web Components
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery Templates
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015
 
Accessibility - A feature you can build
Accessibility - A feature you can buildAccessibility - A feature you can build
Accessibility - A feature you can build
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
 
Levent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & PolymerLevent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & Polymer
 
What is jQuery?
What is jQuery?What is jQuery?
What is jQuery?
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
Web Components + Backbone: a Game-Changing Combination
Web Components + Backbone: a Game-Changing CombinationWeb Components + Backbone: a Game-Changing Combination
Web Components + Backbone: a Game-Changing Combination
 
HTML5와 오픈소스 기반의 Web Components 기술
HTML5와 오픈소스 기반의 Web Components 기술HTML5와 오픈소스 기반의 Web Components 기술
HTML5와 오픈소스 기반의 Web Components 기술
 
[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher
 
HTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery TrainingHTML CSS JavaScript jQuery Training
HTML CSS JavaScript jQuery Training
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
 

Similar to Web Components v1

Web components - An Introduction
Web components - An IntroductionWeb components - An Introduction
Web components - An Introduction
cherukumilli2
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
Luther Baker
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
Eric Palakovich Carr
 
Internet protocol second unit IIPPT.pptx
Internet protocol second unit IIPPT.pptxInternet protocol second unit IIPPT.pptx
Internet protocol second unit IIPPT.pptx
ssuser92282c
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
Gavin Roy
 
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Nidhi Sharma
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
Dilip Patel
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
SPTechCon
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
sapientindia
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
toddbr
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
Mark Rackley
 
Voorhoede - Front-end architecture
Voorhoede - Front-end architectureVoorhoede - Front-end architecture
Voorhoede - Front-end architecture
Jasper Moelker
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
Ioan Eugen Stan
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Gil Fink
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Roy de Kleijn
 
ReactJS.ppt
ReactJS.pptReactJS.ppt

Similar to Web Components v1 (20)

Web components - An Introduction
Web components - An IntroductionWeb components - An Introduction
Web components - An Introduction
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
 
Internet protocol second unit IIPPT.pptx
Internet protocol second unit IIPPT.pptxInternet protocol second unit IIPPT.pptx
Internet protocol second unit IIPPT.pptx
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
 
Voorhoede - Front-end architecture
Voorhoede - Front-end architectureVoorhoede - Front-end architecture
Voorhoede - Front-end architecture
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
 
ReactJS.ppt
ReactJS.pptReactJS.ppt
ReactJS.ppt
 

More from Mike Wilcox

Accessibility for Fun and Profit
Accessibility for Fun and ProfitAccessibility for Fun and Profit
Accessibility for Fun and Profit
Mike Wilcox
 
WTF R PWAs?
WTF R PWAs?WTF R PWAs?
WTF R PWAs?
Mike Wilcox
 
Advanced React
Advanced ReactAdvanced React
Advanced React
Mike Wilcox
 
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need itWebpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need it
Mike Wilcox
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
Mike Wilcox
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatterns
Mike Wilcox
 
Model View Madness
Model View MadnessModel View Madness
Model View Madness
Mike Wilcox
 
Hardcore JavaScript – Write it Right
Hardcore JavaScript – Write it RightHardcore JavaScript – Write it Right
Hardcore JavaScript – Write it Right
Mike Wilcox
 
The Great Semicolon Debate
The Great Semicolon DebateThe Great Semicolon Debate
The Great Semicolon Debate
Mike Wilcox
 
AMD - Why, What and How
AMD - Why, What and HowAMD - Why, What and How
AMD - Why, What and How
Mike Wilcox
 
Dojo & HTML5
Dojo & HTML5Dojo & HTML5
Dojo & HTML5
Mike Wilcox
 
Webpage Design Basics for Non-Designers
Webpage Design Basics for Non-DesignersWebpage Design Basics for Non-Designers
Webpage Design Basics for Non-Designers
Mike Wilcox
 
Why You Need a Front End Developer
Why You Need a Front End DeveloperWhy You Need a Front End Developer
Why You Need a Front End Developer
Mike Wilcox
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
Mike Wilcox
 
The Fight Over HTML5
The Fight Over HTML5The Fight Over HTML5
The Fight Over HTML5
Mike Wilcox
 
The Fight Over HTML5
The Fight Over HTML5The Fight Over HTML5
The Fight Over HTML5
Mike Wilcox
 
How to get a Job as a Front End Developer
How to get a Job as a Front End DeveloperHow to get a Job as a Front End Developer
How to get a Job as a Front End Developer
Mike Wilcox
 
The History of HTML5
The History of HTML5The History of HTML5
The History of HTML5
Mike Wilcox
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?
Mike Wilcox
 
Flash And Dom
Flash And DomFlash And Dom
Flash And Dom
Mike Wilcox
 

More from Mike Wilcox (20)

Accessibility for Fun and Profit
Accessibility for Fun and ProfitAccessibility for Fun and Profit
Accessibility for Fun and Profit
 
WTF R PWAs?
WTF R PWAs?WTF R PWAs?
WTF R PWAs?
 
Advanced React
Advanced ReactAdvanced React
Advanced React
 
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need itWebpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need it
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
 
Professional JavaScript: AntiPatterns
Professional JavaScript: AntiPatternsProfessional JavaScript: AntiPatterns
Professional JavaScript: AntiPatterns
 
Model View Madness
Model View MadnessModel View Madness
Model View Madness
 
Hardcore JavaScript – Write it Right
Hardcore JavaScript – Write it RightHardcore JavaScript – Write it Right
Hardcore JavaScript – Write it Right
 
The Great Semicolon Debate
The Great Semicolon DebateThe Great Semicolon Debate
The Great Semicolon Debate
 
AMD - Why, What and How
AMD - Why, What and HowAMD - Why, What and How
AMD - Why, What and How
 
Dojo & HTML5
Dojo & HTML5Dojo & HTML5
Dojo & HTML5
 
Webpage Design Basics for Non-Designers
Webpage Design Basics for Non-DesignersWebpage Design Basics for Non-Designers
Webpage Design Basics for Non-Designers
 
Why You Need a Front End Developer
Why You Need a Front End DeveloperWhy You Need a Front End Developer
Why You Need a Front End Developer
 
A Conversation About REST
A Conversation About RESTA Conversation About REST
A Conversation About REST
 
The Fight Over HTML5
The Fight Over HTML5The Fight Over HTML5
The Fight Over HTML5
 
The Fight Over HTML5
The Fight Over HTML5The Fight Over HTML5
The Fight Over HTML5
 
How to get a Job as a Front End Developer
How to get a Job as a Front End DeveloperHow to get a Job as a Front End Developer
How to get a Job as a Front End Developer
 
The History of HTML5
The History of HTML5The History of HTML5
The History of HTML5
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?
 
Flash And Dom
Flash And DomFlash And Dom
Flash And Dom
 

Recently uploaded

Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 

Recently uploaded (20)

Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 

Web Components v1

  • 2. by Mike Wilcox, January 2017 Web Components and ES6 Classes
  • 3. JS Frameworks • Some more mobile friendly than others • Although hard to say that any of them truly are • Jeff Atwood complains about poor Ember perf for Discourse • Isomorphic/Universal Apps using server side rendering • Creates faster visual content on the page • But also creates a “valley of death” where the page is no functional • Virtual DOM can sometimes be effective • Sometimes effective • Sometimes not • On demand loading • Some frameworks support it, some don’t
  • 6. Dojo <div class='createSection' data-dojo-attach-point='createSection'>
 <div class='row'>
 <div data-dojo-attach-point="filterName"
 data-dojo-type="app/components/ui/TextFilter" 
 data-dojo-props="fieldLabel:'${messages.filterName}', required: true”>
  • 7. Dojo <div class='field'>
 ${labelNode}
 <div data-dojo-attach-point="textbox" class='fieldWidget'
 data-dojo-type="dijit/form/TextBox"
 data-dojo-attach-event="onKeyUp: _update"></div>
 </div>
  • 8. define([
 'dojo/_base/declare',
 'dx/Widget',
 'dojo/text!./templates/TextFilter.html',
 'dijit/form/TextBox'
 ], function(declare, Widget, template) {
 
 return declare(Widget, {
 templateString: template,
 postMixInProperties: function(){ },
 postCreate: function(){ },
 focus: function(){
 this.textbox.focus();
 },
 _setValueAttr: function(value){
 this.textbox.set('value', value);
 },
 
 _getValueAttr: function(){
 return this.textbox.get('value');
 }, Dojo
  • 11. Ember <div class="nav-items">
 {{#each nav as |link|}}
 {{#unless (eq link.state "hidden") }}
 {{#if (eq link.state "disabled") }}
 <div class="side-nav-link {{link.state}}">
 <div class="side-nav-title">{{link.title}}</div>
 </div>
 {{else}}
 {{#link-to link.route title=link.title class=link.state}}
 <div class="side-nav-link {{link.state}}">
 <div class="side-nav-title">{{link.title}}</div>
 </div>
 {{/link-to}}
 {{/if}}
 {{/unless}}
 {{/each}}
 </div>
  • 12. Ember import Ember from ‘ember'; import Navigation from '../../mixins/navigation'; 
 export default Ember.Component.extend(Navigation, {
 classNames: ['side-nav'],
 nav: null, clientId: ‘NA’, activeNavigation: Ember.computed('navigation', function () {
 let activeNavigationObject = [];
 this.get('navigation').forEach((mainItem)=> {
 ...
 });
 return activeNavigationObject;
 }), 
 });
  • 14. Angular <div [ngBusy]="{busy: busy, message: 'Please wait...'}">
 <div *ngIf="settingView">
 <my-actions [links]="settingView.actionUrls"></my-actions>
 </div>
 </div>
  • 15. Angular <h4>Actions</h4>
 <div class="section">
 <a href="{{links[0]}}">Change Your Password</a>
 <a href="{{links[1]}}">Change Your Security Questions</a>
 <a href="{{links[2]}}">Change other usernames for a Single Sign- On Experience</a>
 </div>
  • 16. Angular import { Component, Input, OnInit } from '@angular/core';
 
 @Component({
 moduleId: module.id.toString(),
 selector: 'my-actions',
 templateUrl: 'actions.component.html'
 })
 export class ActionsComponent implements OnInit {
 constructor() { }
 
 @Input()
 links: string[] = [];
 
 ngOnInit() { }
 }
  • 17. React
  • 18. React import React from 'react';
 import { render } from 'react-dom';
 import Text from './form-sections/text';
 export default class Form extends React.Component {
 constructor(props) {
 super(props);
 }
 render() {
 return ( 
 <ay-form ref="form">
 <Text />
 </ay-form> 
 );
 }
 }

  • 19. React import React from 'react';
 import { render } from 'react-dom';
 import pure from 'react-addons-pure-render-mixin';
 
 export default class Text extends React.Component {
 constructor(props) {
 super(props);
 this.shouldComponentUpdate = pure.shouldComponentUpdate.bind(this);
 }
 render() {
 return (
 <section>
 <ay-field type="text" value="" name="where" placeholder="Where"></ay-field>
 </section>
 );
 }
 }
  • 22. JS Frameworks + Web Components • Web Components are “just HTML” so they will work with all of them • It may require some manual wiring, like using addEventListener • With plugins, you can make use of framework template functionality • https://github.com/webcomponents/react-integration • https://github.com/clubajax/react-inject-change-events
  • 24. Web Components Benefits • Part of the DOM - lifecycle tools for free! • Future-proof and cross-browser (web standard) for creating and extending reusable components. • Requires no library or framework to get started. Vanilla JS/HTML FTW! • Provides a familiar programming model. It's just DOM/CSS/HTML. • Creates a very modular system • Tightly integrated with the browser's DevTools. • Leverage existing accessibility features.
  • 25. Web Components • Custom Elements • Shadow DOM • Templates • HTML Imports All four of these items are a WC3 spec, all of which makes up Web Components
  • 26. Custom Elements • Define your own element types and functionality • Provides a standard way to associate JavaScript logic with an element • Lifecycle methods • No confusing context — “this” is the element • Easy to inspect in debuggers We could do custom elements with IE6… the difference is the life cycle methods <x-tabs>
 <ul>Tab 1</ul>
 <ul>Tab 2</ul>
 <ul>Tab 3</ul>
 </x-tabs>
  • 27. Shadow DOM Content can be “projected” into provided slots • Shadow DOM refers to the ability of the browser to include a subtree of DOM elements into the rendering of a document, but not into the main document DOM tree. • CSS style rules are constrained to the shadow tree they were defined in. • The DOM is also encapsulated. For example, document.querySelectorAll('div'); will not return any results from a custom element with Shadow DOM
  • 28. Templates • The template element is used to declare fragments of HTML that can be cloned and inserted in the document by script. • Contains a DocumentFragment in its HTMLTemplateElement.content property
  • 29. HTML Imports <link rel=“import” href=“./my-bugger.html” />
 <link rel=“import” href=“./my-zapper.html” /> • Can import all in one file: JavaScript, HTML, and CSS • Effectively, an HTML document. • HTML Imports can be the dependency management system, replacing AMD or CommonJS • HTML Imports let you include and reuse HTML documents in other HTML documents, just as script tags let you include external JavaScript in their pages.
  • 30. HTML Imports - CONS The HTML Import spec does not have consensus. Mozilla is still holding out, after two years. <link rel=“import” href=“./my-bugger.html” />
 <link rel=“import” href=“./my-zapper.html” /> • Confusing context when importing templates • Spec essentially competes with ES modules • Globals
  • 32. Browser Support • Chrome v54 • WebKit Nightly v18 • Edge has begun prototyping • Firefox has an open bug
  • 34. We need to support old IE because we… • want to expose our servers to unsupported, insecure browsers. • like to pay the extra IE development cost (8:25%, 9:10%, 10:5%). • enjoy tying up QA to spend extra time testing more browser versions https://www.xfive.co/blog/stop-supporting-ie10-ie9-ie8/ Seriously, management often encourages the support of old versions because they are not aware of the cost and risk.
  • 35. Polyfills • A polyfill for HTML Custom Elements. • ShadyDOM provides a shim for ShadowDOM V1. It is less correct but less intrusive and faster than the ShadowDOM Polyfill. • ShadyCSS provides a shim for CSS Custom Properties, CSS Mixins with @apply support, and ShadowDOM V1 style encapsulation with the ShadyDOM library.
  • 36. v0 vs v1* *The differences between the old spec and the recent changes
  • 37. v0 var proto = Object.create(HTMLElement.prototype);
 proto.createdCallback = function() {
 // invoked on creation
 };
 proto.attachedCallback = function() {
 // invoked when added to the document
 };
 proto.detachedCallback = function() {
 // invoked when removed from the document
 };
 proto.attributeChangedCallback = function(attrName, oldVal, newVal) {
 // invoked when an attribute is changed
 }; 
 var MyComponent = document.registerElement('my-component', {
 prototype: proto
 });
  • 38. class MyComponent extends HTMLElement {
 static get observedAttributes() { return ['value', 'disabled']; }
 constructor ( ) {
 super();
 }
 connectedCallback ( ) { }
 disconnectedCallback ( ) { }
 attributeChangedCallback(attrName, oldVal, newVal) { }
 adoptedCallback() { }
 }
 customElements.define('my-component', MyComponent); v1 constructor: the element is created or upgraded connectedCallback: the element is inserted into the DOM disconnectedCallback: the element is removed from the DOM. attributeChangedCallback: an attribute was added, removed, or updated adoptedCallback the element has been moved into a new document define: exposes the element name for use in markup
  • 39. History Q: Why did the spec change? A: The old spec did not work with ES6 classes Q: Does the new spec work wth ES5? A: uh, sort of… Q: Who changed it? A: Blame Apple's Ryosuke Niwa. He’s made a few changes… Q: Should I wait to use Web Components until v1 is implemented? A: No, not any more than you would wait for any other shim-able browser feature
  • 40. Inheritance class MyButton extends HTMLButtonElement {
 constructor () {
 super(...arguments);
 }
 }
 customElements.define('my-button', MyButton, {extends: 'button'}); Extends something other than HTMLElement Extra argument when defining Blocked by Apple. Use native tag, and extended tag in “is” This is what it would look like… if it were implemented.
  • 41. ES6 Classes class MyComponent extends HTMLElement {
 static something () { return 'something'; }
 constructor () {
 super();
 }
 connectedCallback () {
 //
 }
 } always call super() first in the constructor. “this” is not established until after Commas are forbidden to emphasize that class definitions are different from object literals. Classes are sugar for prototypal inheritance. MyComponent is a function that inherits from the HTMLElement prototype. static is similar to: MyComponent.something = function () { return ’something’; } data properties are not allowed like in objects: {a: true} (yet) getters and setters must be used. super is used as a function in the constructor, as property references: super.someMethod();
  • 42. Custom Element API Considerations • Sync important properties with attributes • getters/setters over methods • Broadcast changes via events • Use standard properties and event names (“value”, “change”) • innerHTML — what happens, before and after initialization? • Appending children • Use :defined or alternative • Consider Shadow DOM styling pros and cons
  • 43. DEMOS