Developing Web Components Год издания: 2015 Автор: Jarrod Overson, Jason Strimpel Издательство: O'Reilly Media ISBN: 978-1-4919-4900-9, 978-1-4919-4902-3 Язык: Английский Формат: ePub Качество: Изначально компьютерное (eBook) Интерактивное оглавление: Да Количество страниц: 201 Описание: 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.
Примеры страниц
Оглавление
Chapter 1 Introduction What Are Web Components? Why Web Components? UI Core Concepts Chapter 2 Creating 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 3 Normal Flow and Positioning Normal Flow Positioning Elements Calculating an Element’s Position Positioning the Dialog Widget Summary Chapter 4 Understanding 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 5 Cloning Nodes Using the cloneNode Method Using jQuery.clone Continuation of the Dialog Widget Summary Chapter 6 Constructing an Overlay Defining an API Utilities Updating Options Destroying Positioning Adding the Overlay to the Dialog Widget Summary Chapter 7 Making 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 8 Resizing 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 9 Completing the Dialog Widget Styling the Widget Concatenating the JavaScript Summary Building HTML5 Web Components Chapter 10 Utilizing 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 11 Working 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 12 Creating 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 13 Importing 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 14 Introducing Polymer Polymer Elements Template Syntax Attributes and Properties—Your Element’s API Polymer’s JavaScript APIs Summary Chapter 15 Porting 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 16 Testing Web Components PhantomJS 1 PhantomJS 2 Selenium WebDriver Karma Test Specs Running Our Tests Summary Chapter 17 Packaging and Publishing Vulcanize Gulp Grunt Publishing with Bower Summary Chapter 18 Final Words Where Do We Go from Here? Good Luck!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum