Getting Started
摘要
Coding is a messy business. Ouch. Why? We all work on projects – some for clients, some for personal development; chances are we need to apply fixes to our code at some point, then apply fixes on fixes. Very soon, things become messy and unmanageable – sound familiar? We need a different approach – we can create components or modules to serve a single responsibility, such as a button. This encapsulated code works great, but we typically might use a framework such as React to do this – what if I said this might not be necessary? Let me introduce you to the Shadow DOM API: this is built into any modern browser and allows us to construct components, without the need for that framework. True, it might not work for all components, but the beauty of this framework is that we can create components that can be used with any framework! I’ll take you through the basics of the API, and show you how this tool might be something to consider when creating your next project.