Skip to content

Commit 25fcba2

Browse files
committed
Moving all chapter and book frontmatter files into the top level of the directory
1 parent 590ca49 commit 25fcba2

17 files changed

+24
-24
lines changed

Diff for: β€Žatlas.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"branch": "master",
33
"files": [
4-
"sections/cover.html",
5-
"sections/toc.html",
6-
"sections/foreword.asciidoc",
7-
"sections/preface.asciidoc",
8-
"chapters/ch01.asciidoc",
9-
"chapters/ch02.asciidoc",
10-
"chapters/ch03.asciidoc",
11-
"chapters/ch04.asciidoc",
12-
"chapters/ch05.asciidoc",
13-
"chapters/ch06.asciidoc",
14-
"chapters/ch07.asciidoc",
15-
"chapters/ch08.asciidoc",
16-
"chapters/ch09.asciidoc"
4+
"cover.html",
5+
"toc.html",
6+
"foreword.asciidoc",
7+
"preface.asciidoc",
8+
"ch01.asciidoc",
9+
"ch02.asciidoc",
10+
"ch03.asciidoc",
11+
"ch04.asciidoc",
12+
"ch05.asciidoc",
13+
"ch06.asciidoc",
14+
"ch07.asciidoc",
15+
"ch08.asciidoc",
16+
"ch09.asciidoc"
1717
],
1818
"formats": {
1919
"pdf": {
@@ -61,4 +61,4 @@
6161
"print_isbn13": "",
6262
"lang": "en",
6363
"accent_color": "cmyk(100%, 3%, 50%, 0%)"
64-
}
64+
}

Diff for: β€Žchapters/ch01.asciidoc renamed to β€Žch01.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ console.log(double(3))
9898

9999
To the right of the source code we've entered, you'll see the transpiled ES5 equivalent. As you update your source code, the transpiled result is also updated in real-time.
100100

101-
image::../images/c01g01-babel-repl.png["Babel REPL"]
101+
image::images/c01g01-babel-repl.png["Babel REPL"]
102102

103103
The Babel REPL is an effective companion as a way of trying out some of the features introduced in this book. However, note that Babel doesn't transpile new built-ins, such as `Symbol`, `Proxy` and `WeakMap`. Those references are instead left untouched, and it's up to the runtime executing the Babel output to provide those built-ins. If we want to support runtimes that haven't yet implemented these built-ins, we could import the `babel-polyfill` package in our code.
104104

@@ -283,7 +283,7 @@ if(false){}
283283

284284
When we run the `lint` script, ESLint describes everything that's wrong with the file.
285285

286-
image::../images/c01g02-eslint-cli.png["Validating a piece of source code through ESLint."]
286+
image::images/c01g02-eslint-cli.png["Validating a piece of source code through ESLint."]
287287

288288
ESLint is able to fix most style problems automatically if we pass in a `--fix` flag. Add the following script to your `package.json`.
289289

File renamed without changes.
File renamed without changes.

Diff for: β€Žchapters/ch04.asciidoc renamed to β€Žch04.asciidoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ When we chain promises, we need to understand that `p1.then(r1).then(r2)` create
113113
114114
Figuring out the tree-like nature of promises is the key to unlocking a deep understanding of how promises behave. To this end, I've created an online tool called Promisees you can use to play around with promise chains while visualizing the tree structure they leave behind.
115115
116-
image::../images/c04g01-promisees.png["Promisees lets you write a piece of code and visualize how the underlying graph evolves as promises are settled in fulfillment or rejection."]
116+
image::images/c04g01-promisees.png["Promisees lets you write a piece of code and visualize how the underlying graph evolves as promises are settled in fulfillment or rejection."]
117117
118118
You can find Promisees at https://mjavascript.com/out/promisees.
119119
====
@@ -222,11 +222,11 @@ const p3 = p2.catch(err => console.error(err))
222222

223223
Here is another situation where it might help you to think of promises as a tree-like data structure. In the following illustration it becomes clear that, given the error originates in the `p2` node, we couldn't notice it by attaching a rejection reaction to `p1`.
224224

225-
image::../images/c04g02-promise-split-chain.png["The p3 rejection handler in this example won't be able to catch the failure in p2's reaction, since it reacts to p1 instead of p2."]
225+
image::images/c04g02-promise-split-chain.png["The p3 rejection handler in this example won't be able to catch the failure in p2's reaction, since it reacts to p1 instead of p2."]
226226

227227
In order for the reaction to handle the rejection in `p2`, we'd have to attach the reaction to `p2` instead.
228228

229-
image::../images/c04g03-promise-serial-chain.png["In this example, p3 reacts to p2. This enables p3 to handle the rejection that arises in p2."]
229+
image::images/c04g03-promise-serial-chain.png["In this example, p3 reacts to p2. This enables p3 to handle the rejection that arises in p2."]
230230

231231
We've established that the promise you attach your reactions onto is important, as it determines what errors it can capture and what errors it can not. It's also worth noting that as long as an error remains uncaught in a promise chain, a rejection handler will be able to capture it. In the following example we've introduced an intermediary `.then` call in between `p2`, where the error originated; and `p4`, where we attach the rejection reaction. When `p2` settles with a rejection, `p3` becomes settled with a rejection as it depends on `p2` directly. When `p3` settles with a rejection, the rejection handler in `p4` fires.
232232

@@ -306,7 +306,7 @@ Here is an enumeration of what is going on as that piece of code is executed.
306306

307307
You should think of promises as a tree structure. This bears repetition: you should think of promises as a tree structurefootnoteref:[promisees,I wrote an online visualization tool called Promisees where you can see the tree structure underlying a Promise chain: https://mjavascript.com/out/promisees.].
308308

309-
image::../images/c04g04-promise-chain.png["Promisees can help us visualize how the fetch promise is fulfilled, but p2 is rejected, thus triggering any rejection reactions attached to it. Given p3 is fulfilled, rejection reactions like p4 are never executed."]
309+
image::images/c04g04-promise-chain.png["Promisees can help us visualize how the fetch promise is fulfilled, but p2 is rejected, thus triggering any rejection reactions attached to it. Given p3 is fulfilled, rejection reactions like p4 are never executed."]
310310

311311
It all starts with a single promise, which we'll next learn how to construct. Then you add branches with `.then` or `.catch`. You can tack as many `.then` or `.catch` calls as you want onto each branch, creating new branches, and so on.
312312

@@ -810,7 +810,7 @@ This sort of abstraction of complexity into another function often helps keep co
810810
====
811811
Iterators don't have any knowledge that the sequences they produce are infinite. In a similar situation to the famous halting problem, there is no way of knowing whether the sequence is infinite or not in code.
812812
813-
image::../images/c04g05-halting-problem.png["The halting problem depicted in an XKCD comic: https://mjavascript.com/out/xkcd-1266."]
813+
image::images/c04g05-halting-problem.png["The halting problem depicted in an XKCD comic: https://mjavascript.com/out/xkcd-1266."]
814814
815815
You typically have a good idea of whether a sequence is infinite or not. Whenever you have an infinite sequence it's up to you to add an escape condition that ensures the program won't crash in an attempt to loop over every single value in the sequence. While `for..of` won't run into the problem unless there's no escape condition, using mechanisms such as spread or `Array.from` would immediately result in the program crashing into an infinite loop in the case of infinite sequences.
816816
====
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: β€Žchapters/ch08.asciidoc renamed to β€Žch08.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ console.log(html)
9090

9191
The following screenshot shows our tiny application in action.
9292

93-
image::../images/c08g01-grocery-item.png["Printing an item for our grocery shopping list"]
93+
image::images/c08g01-grocery-item.png["Printing an item for our grocery shopping list"]
9494

9595
The next template we'll make renders the grocery list itself. It receives an array of items, and renders each of them by reusing the `item.js` template from the previous code snippet.
9696

@@ -122,7 +122,7 @@ console.log(html)
122122

123123
The following screenshot shows our updated application in all its glory.
124124

125-
image::../images/c08g02-grocery-list.png["Printing a grocery shopping list"]
125+
image::images/c08g02-grocery-list.png["Printing a grocery shopping list"]
126126

127127
In the examples so far, we've written short modules that are only concerned with producing an HTML view after matching a `model` object with the corresponding view template. A simple API encourages reusability, which is why we're easily able to render the items for a list by mapping their models to the `item.js` templating function, and joining their HTML representations with newlines.
128128

@@ -155,7 +155,7 @@ console.log(render('list', [{
155155
}]))
156156
----
157157

158-
image::../images/c08g03-dynamic-render.png["Printing different views through a normalized render function."]
158+
image::images/c08g03-dynamic-render.png["Printing different views through a normalized render function."]
159159

160160
Moving on, you'll notice that ES6 modules are somewhat influenced by CommonJS. In the next few sections we'll look at `export` and `import` statements, and learn how ESM is compatible with CJS.
161161

File renamed without changes.
File renamed without changes.

Diff for: β€Žsections/cover.html renamed to β€Žcover.html

File renamed without changes.
File renamed without changes.

Diff for: β€Žsections/ix.html renamed to β€Žix.html

File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: β€Žsections/toc.html renamed to β€Žtoc.html

File renamed without changes.

0 commit comments

Comments
Β (0)