Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed May 15, 2017
1 parent 5ffbd67 commit 12df19e
Show file tree
Hide file tree
Showing 7 changed files with 3,913 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/webpack2-slides/30-fast1/01-bundling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Why is bundling better than serving modules directly?

* βš—οΈ browsers *don't support modules* (currently)
* βš—οΈ not all browsers *support modules*
* 🚈 *fewer requests*
* βœ‚οΈ *better gzipping*
* πŸ“§ *less* browser *overhead*
Expand Down
21 changes: 21 additions & 0 deletions app/webpack2-slides/30-fast1/02-on-demand-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,24 @@ onclick = () => {
.catch(err => { /*...*/ }); 🚧 // handle loading error
};
```

---

---

## πŸ€“ On Demand Loading πŸ€“ [Expert]

``` js
// Give the chunk a name
import( /* webpackChunkName: "my-chunk" */"module-a")
```

``` js
// Join chunks with equal name
import(/* webpackChunkName: "my-chunk" */"module-b")
```

``` js
// *Simple* expressions are supported
import(`./pages/${page}`)
```
4 changes: 2 additions & 2 deletions app/webpack2-slides/50-fast2/10-server-side-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Display content faster.
* Frontend code often **doesn't run on node.js**
* *imports CSS, Images, Fonts, etc.*
* webpack has a **`target`** option
* defaults to `web`
* **`node`**: Build bundle for node.js
* defaults to `"web"`
* **`"node"`**: Build bundle for node.js
* *separate config* for server build
* `style-loader` -> **`null-loader`**
* `file-loader` -> **`file-loader { emitFile: false }`**
Expand Down
10 changes: 5 additions & 5 deletions app/webpack2-slides/55-popular-apps/20-popular-webpack-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
* 1 manifest chunk (but not inlined πŸ€”)
* πŸ“¦ 1 vendor chunk
* πŸ“¦ 1 app chunk (**App Shell**)
* πŸ“¦ 48 **language chunks** (globalize-webpack-plugin)
* πŸ“¦ 41 page chunks
* πŸ“‘πŸ“¦ 2 on demand chunks
* πŸ”‹ **Service Worker** (serving App, but not Content)
* installed too early? Slows down connection.
* πŸ“¦ 44 **language chunks** (globalize-webpack-plugin)
* πŸ“¦ 37 page chunks
* πŸ“‘πŸ“¦ 4 on demand chunks
* πŸ”‹ **Service Worker** (serving App and Content)
* https://blog.twitter.com/2017/how-we-built-twitter-lite
2 changes: 1 addition & 1 deletion app/webpack2.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var deck = bespoke.from("article", [
theme(),
scale(),
progress({
time: 30 * 60 * 1000
time: 40 * 60 * 1000
})
]);

Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,5 @@
"style-loader": "^0.12.4",
"webpack": "^2.2.0",
"webpack-dev-server": "^2.0.0"
},
"devDependencies": {
"gh-pages": "^0.4.0"
}
}
Loading

0 comments on commit 12df19e

Please sign in to comment.