Developing Web Components - Jarrod Overson, Jason Strimpel

Developing Web Components

UI from jQuery to Polymer
Buch | Softcover
252 Seiten
2015
O'Reilly Media (Verlag)
978-1-4919-4902-3 (ISBN)
26,85 inkl. MwSt
Although web components are still on the bleeding edge—barely supported in modern browsers—the technology is also moving extremely fast. This practical guide gets you up to speed on the concepts underlying W3C’s emerging standard and shows you how to build custom, reusable HTML5 Web Components.

Regardless of your experience with libraries such as jQuery and Polymer, this book teaches JavaScript developers the DOM manipulations these libraries perform. You’ll learn how to build a basic widget with vanilla JavaScript and then convert it into a web component that’s semantic, declarative, encapsulated, consumable, and maintainable.

With custom components, the Web can finally fulfill its potential as a natively extensible application platform. This book gets you in at the right time.

  • Understand core concepts (such as normal flow and positioning, and Z-index) for properly positioning, dragging, and resizing elements
  • Explore UI concepts and patterns typically abstracted away by Dojo, jQuery UI, Kendo UI, and other libraries
  • Dive into the W3C standard and convert your working widget example into a fully functioning web component
  • Learn how to encapsulate, package, and deploy your web components with Google’s Polymer framework

Jarrod Overson has been developing on the web for over 15 years in both startups and global companies and currently works at Shape Security. He founded Gossamer to help bootstrap companies into developing for the modern web and has provided free community training on everything from node to backbone. Jarrod is an active proponent and contributor to open source, creator of Plato, and a member of the Grunt, Marionette, and ES-Analysis teams.

Jason Strimpel is a Staff Software Engineer on the platform team at WalmartLabs who specializes in the UI layer. Jason has been building web applications for the past 12 years. Approximately 3 years ago Jason began specializing in the front-end, in particular JavaScript. Since then Jason has worked with several component libraries and frameworks. However, Jason found limitations to these libraries when presented with uniquely challenging UI requirements, so he began developing his own custom components and catalog of helpers. He is an extremely passionate developer with a very bad sense of humor who loves simplifying the complexities that arise when building rich UIs.

Chapter 1Introduction
What Are Web Components?
Why Web Components?
UI Core Concepts
Chapter 2Creating a Solid Foundation
The Importance of a DOM Abstraction Layer
API Design and Widget Life Cycle
The Inheritance Pattern
Dependencies
Optimization
A Web Component Is Not JavaScript Alone
Example Widget
Summary
Chapter 3Normal Flow and Positioning
Normal Flow
Positioning Elements
Calculating an Element’s Position
Positioning the Dialog Widget
Summary
Chapter 4Understanding and Managing z-index
What Exactly Is the z-index Property?
Rendering Layers, Stacking Order, and z-index
Stacking Contexts
Managing z-indexes
Converting to a jQuery Plugin
Adding z-index Management to the Dialog Widget
Summary
Building Our UI
Chapter 5Cloning Nodes
Using the cloneNode Method
Using jQuery.clone
Continuation of the Dialog Widget
Summary
Chapter 6Constructing an Overlay
Defining an API
Utilities
Updating Options
Destroying
Positioning
Adding the Overlay to the Dialog Widget
Summary
Chapter 7Making Elements Draggable
Mouse Events
Mouse Events Best Practices
Defining an API
Creating a Drag Handle
Making Things Move
Destroying a Draggable Instance
Making the Dialog Widget Draggable
Summary
Chapter 8Resizing Elements
Mouse Events and Best Practices (Recap)
Resizing an Element
Making a Resizable API
Defining Drag Handles
Binding Event Handlers
Destroying a Resizable Instance
Completed Resizing Library
Making the Dialog Widget Resizable
Summary
Chapter 9Completing the Dialog Widget
Styling the Widget
Concatenating the JavaScript
Summary
Building HTML5 Web Components
Chapter 10Utilizing Templates
Understanding the Importance of Templates
Creating and Using a Template
Converting the Dialog Component to a Template
Abstracting the Dialog Template Wrapper
Summary
Chapter 11Working with the Shadow DOM
What Is the Shadow DOM?
Shadow DOM Basics
Using a Template with the Shadow DOM
Shadow DOM Styling
Content Projection
Shadow Insertion Points
Events and the Shadow DOM
Updating the Dialog Template to Use the Shadow DOM
Summary
Chapter 12Creating Custom Elements
Introducing Custom Elements
Registering Custom Elements
Extending Elements
Defining Properties and Methods
Resolving Custom Elements
Hooking Into Custom Element Life Cycles
Styling Custom Elements
Utilizing Templates and the Shadow DOM with Custom Elements
Converting the Dialog Component to a Custom Element
Summary
Chapter 13Importing Code
Declaring an Import
Accessing an Import’s Content
Understanding Imports in Relation to the Main Document
Loading Custom Elements
Importing the Dialog
Summary
Testing, Building, and Deploying Components with Polymer
Chapter 14Introducing Polymer
Polymer Elements
Template Syntax
Attributes and Properties—Your Element’s API
Polymer’s JavaScript APIs
Summary
Chapter 15Porting Our Dialog to Polymer
Why Port Anything to Polymer at All?
The Direct Port
That Was Easy—A Little Too Easy!
jQuery in a Polymer World
Summary
Chapter 16Testing Web Components
PhantomJS 1
PhantomJS 2
Selenium WebDriver
Karma
Test Specs
Running Our Tests
Summary
Chapter 17Packaging and Publishing
Vulcanize
Gulp
Grunt
Publishing with Bower
Summary
Chapter 18Final Words
Where Do We Go from Here?
Good Luck!

Erscheint lt. Verlag 24.3.2015
Verlagsort Sebastopol
Sprache englisch
Maße 184 x 230 mm
Gewicht 432 g
Einbandart Paperback
Themenwelt Informatik Software Entwicklung User Interfaces (HCI)
Informatik Web / Internet HTML / CSS
Informatik Web / Internet JavaScript
Schlagworte HTML5 • JavaScript • jQuery (Framework); Handbuch/Lehrbuch • Polymer • User Interfaces • Web user interfaces
ISBN-10 1-4919-4902-3 / 1491949023
ISBN-13 978-1-4919-4902-3 / 9781491949023
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Wie bewerten Sie den Artikel?
Bitte geben Sie Ihre Bewertung ein:
Bitte geben Sie Daten ein:
Mehr entdecken
aus dem Bereich
Aus- und Weiterbildung nach iSAQB-Standard zum Certified Professional …

von Mahbouba Gharbi; Arne Koschel; Andreas Rausch; Gernot Starke

Buch | Hardcover (2023)
dpunkt Verlag
34,90