This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.
Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"
Web Components in Action teaches you to build and use Web Components from the ground up. You'll start with simple components and component-based applications, using JavaScript, HTML, and CSS. Then, you'll customize them and apply best design practices to maximize reusability. Through hands-on projects, you'll learn to build production-ready Web Components for any project, including color pickers, advanced applications using 3D models, mixed reality, and machine learning.
Author(s): Ben Farrell Publisher: Manning Publications Year: 2019
Language: English Pages: 858
Copyright......Page 3 Brief Table of Contents......Page 6 Table of Contents......Page 8 Foreword......Page 23 Preface......Page 27 Acknowledgments......Page 31 About this book......Page 33 About the cover illustration......Page 41 Part 1. First steps......Page 42 Chapter 1. The framework without a framework......Page 43 1.1. What are Web Components?......Page 48 1.2. The future of Web Components......Page 61 1.3. Beyond the single component......Page 64 1.4. Your project, your choice......Page 72 Summary......Page 74 Chapter 2. Your first Web Component......Page 75 2.1. Intro to HTMLElement......Page 76 2.2. Rules for naming your element......Page 82 2.3. Defining your custom element (and handling collisions)......Page 85 2.4. Extending HTMLElement to create custom component logic......Page 88 2.5. Using your custom element in practice......Page 96 2.6. Making a (useful) first component......Page 101 2.7. Notes on browser support......Page 125 Summary......Page 127 Chapter 3. Making your component reusable......Page 128 3.1. A real-world component......Page 129 3.2. Making our component configurable......Page 143 3.3. Using attributes for configuration......Page 148 3.4. Listening for attribute changes......Page 153 3.5. Making more things even more customizable......Page 162 3.6. Updating the slider component......Page 172 Summary......Page 181 Chapter 4. The component lifecycle......Page 182 4.1. The Web Components API......Page 183 4.2. The connectedCallback handler......Page 185 4.3. The remaining Web Component lifecycle methods......Page 198 4.4. Comparing to React’s lifecycle......Page 204 4.5. Comparing to a game engine lifecycle......Page 208 4.6. Component lifecycle v0......Page 219 Summary......Page 221 Chapter 5. Instrumenting a better web app through modules......Page 222 5.1. Using the