From the course: Web Components and Modularization: Practical Approaches

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Tip: Map your file tree to the DOM

Tip: Map your file tree to the DOM

From the course: Web Components and Modularization: Practical Approaches

Start my 1-month free trial

Tip: Map your file tree to the DOM

- [Instructor] After drawing out all the components you think you'll need in the design mockup and drafting out a DOM tree for each of these components, it's time to migrate from conceptual sketches to real code. I have a tip for you here. One that someone gave me early on in my own learning. Take this opportunity to map your DOM tree to the file structure of your project. Let me explain, thanks to modern JavaScript modules we can export and import live bindings, functions and primitives between files, allowing for granular modularization of our components. This gives us one of the major benefits of working with components. Each component can be contained in its own file or in its own folder and we can organize these files and folders in ways that make sense to us and makes working with each component as easy as possible. As you start working on your own project in code, building out the file tree to match the DOM tree…

Contents