Webcomponents v2
-
Upload
dmitry-bakaleinik -
Category
Technology
-
view
1.775 -
download
1
Transcript of Webcomponents v2
Web componentsby����������� ������������������ Dmitry����������� ������������������ Bakaleinik
May����������� ������������������ 2015
[email protected]����������� ������������������ @demongloom
Meet the new W3C heroes
Web Components
In 2013-2014 W3C presented a set of new HTML improvements called Web Components.
Web Components is a standard that is getting really popular these days, Browser support is getting better and we can use libraries such as Polymer, XTags and Bosonic. In addition, Angular 2 will introduce support for Web Components, Shadow DOM, Templating, etc. It’s important to understand all these concepts in order to adopt faster new frameworks and libraries.
Encapsulate and share
In a nutshell, Web Components allow us to encapsulate and share reusable widgets.
The main idea is to been able to bundle markup and styles to create custom components,
all the code will be hidden from the outside world, the markup and the styles will be isolated.
Web in 1990s, HTML pages were lean and simple
HTML and the World Wide Web started in the early 1990's.
Version 1.0 of the first popular, dominant commercial browser,
Netscape Navigator, was released in December 1994.
It supported very simple HTML, which included simple styling and simple forms for data entry.
Later versions in 1995 added tables, cookies, and very early JavaScript. Microsoft released its first browser in 1995.
At this point, extremely rich applications could be written in C++, Visual Basic, or any of many programming systems.
HTML was very lean, with very basic data display and entry.
HTML tag was an alphabet for web
First of all we are beginning to write site code from HTML and not from js/css.
Seman&c(Content(Structure(Style(tags(
Silly(Style(Anima&on(
Behavior(Interac&on(Anima&on(
Content(crea&on(
jQuery
Mootools
Prototype
Dojo
ExtJS
Web in 2000s and until now, rapid growth of UI frameworks
Backbone
AngularJS
The component model for Web
Custom Elements
HTMLTemplates
HTMLImports
ShadowDOM
Let authors define their own elements, with new tag names and new script interfaces.
Defines how templates and custom elements are packaged and loaded as a resource.
Define chunks of markup that are inert but can be activated for use later.
Can I use web components?
Templates ✓ ✓ ✓ ✓ ✓ ✗
Shadow DOM ✓ ✓ ✓* ✓ ✓ ✗
Custom Elements ✓ ✓ ✓* ✗ ✗ ✗
Imports ✓ ✓ ✓* ✗ ✗ ✗
Let authors define their own elements, with new tag names and new script interfaces.
Custom Elements
So for example, <x-tags>, <my-element>, and <my-awesome-app>
are all valid names, while <tabs> and <foo_bar>
are not.
Styling
no����������� ������������������ dot����������� ������������������ ����������� ������������������ in����������� ������������������ selector