Software Tools in JavaScript
by Greg Wilson
- Length: 403 pages
- Edition: 1
- Language: English
- Publication Date: 2021
The best way to learn design is to study examples, and some of the best examples of software design come from the tools programmers use in their own work. In these lessons we build small versions of version control systems, testing frameworks, regular expression matchers, and browser layout engines both to demystify them and to give some insights into how experienced programmers think.
Contents Contents Introduction Who is our audience? What tools and ideas do we cover? How are these lessons laid out? How did we get here? How can people use and contribute to this material? Who helped us and inspired us? Systems Programming How can we list a directory? What is a callback function? What are anonymous functions? How can we select a set of files? How can we copy a set of files? Exercises Asynchronous Programming How can we manage asynchronous execution? How do promises work? How are real promises different? How can we build tools with promises? Lining things up How can we make this more readable? How can we handle errors with asynchronous code? Exercises Unit Testing How should we structure unit testing? How can we separate registration, execution, and reporting? How should we structure test registration? How can we build a command-line interface for testing? Exercises File Backup How can we uniquely identify files? How can we back up files? How can we track which files have already been backed up? How can we test code that modifies files? Design for test Exercises Data Tables How can we implement data tables? How can we test the performance of our implementations? What is the most efficient way to save a table? Does binary storage improve performance? Exercises Pattern Matching How can we match query selectors? How can we implement a simple regular expression matcher? How can we implement an extensible matcher? Exercises Parsing Expressions How can we break text into tokens? How can we turn a list of tokens into a tree? Exercises Page Templates What will our system look like? How can we keep track of values? How do we handle nodes? How do we implement node handlers? How can we implement control flow? How did we know how to do all of this? Exercises Build Manager What's in a build manager? Where should we start? How can we specify that a file is out of date? How can we update out-of-date files? How can we add generic build rules? What should we do next? Exercises Layout Engine How can we size rows and columns? How can we position rows and columns? How can we render elements? How can we wrap elements to fit? What subset of CSS will we support? Exercises File Interpolator How can we evaluate JavaScript dynamically? How can we manage files? How can we find files? How can we interpolate pieces of code? What did we do instead? Exercises Module Loader How can we implement namespaces? How can we load a module? Do we need to handle circular dependencies? How can a module load another module? Exercises Style Checker How can we parse JavaScript to create an AST? How can we find things in an AST? How can we apply checks? How does the AST walker work? How else could the AST walker work? What other kinds of analysis can we do? Exercises Code Generator How can we replace a function with another function? How can we generate JavaScript? How can we count how often functions are executed? How can we time function execution? Exercises Documentation Generator How can we extract documentation comments? What input will we try to handle? How can we avoid duplicating names? Exercises Module Bundler What will we use as test cases? How can we find dependencies? How can we safely combine several files into one? How can files access each other? Exercises Package Manager What is semantic versioning? How can we find a consistent set of packages? How can we implement satisfy constraints? How can we do less work? Exercises Virtual Machine What is the architecture of our virtual machine? How can we execute these instructions? What do assembly programs look like? How can we store data? Exercises Debugger What is our starting point? How can we make a tracing debugger? How can we make the debugger interactive? How can we test an interactive application? Exercises Conclusion Licensing Writing Software Bibliography Code of Conduct Our Standards Our Responsibilities Scope Enforcement Attribution Contributing Making Decisions Formatting What We're Looking For Glossary Links Authors Index
Donate to keep this site alive
To access the Link, solve the captcha.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.