|
4 | 4 |
|
5 | 5 | **This is experimental! There may be breaking changes.** |
6 | 6 |
|
7 | | -This is part of the ABC project. See http://g.co/ng/abc for an overview. |
| 7 | +This is part of the ABC project. The overall goal is to make it possible to |
| 8 | +develop Angular applications the same way we do at Google. |
| 9 | +See http://g.co/ng/abc for an overview. |
8 | 10 |
|
9 | | -See the documentation in the wiki of this repository to install the |
10 | | -necessary dependencies and understand how this works. |
| 11 | +You can read the documentation in the wiki of this repository to understand how |
| 12 | +this works. |
11 | 13 |
|
12 | 14 | Follow https://github.com/angular/angular/issues/19058 for updates. |
13 | 15 |
|
14 | 16 | ## Try it |
15 | 17 |
|
| 18 | +First, we install packages as usual. However, to get the same version of node |
| 19 | +and yarn as co-workers and our continuous integration, let's have Bazel run the |
| 20 | +package manager using a pinned version it manages. |
| 21 | + |
16 | 22 | ```bash |
17 | | -# Install packages, uses hermetic version of node and yarn |
18 | 23 | $ bazel run @yarn//:yarn |
19 | | -# Start up the devserver in watch mode |
20 | | -$ ./node_modules/.bin/ibazel run src:devserver |
21 | | -# Open the URL printed on your terminal. |
22 | | -# Make changes to sources, observe the development round-trip time |
23 | 24 | ``` |
24 | 25 |
|
25 | | -Look at the dependency graph: |
| 26 | +Next we'll run the development server. The `ibazel` command is a "watch mode" |
| 27 | +for Bazel, which means it will watch any files that are inputs to the devserver, |
| 28 | +and when they change it will ask Bazel to re-build them. The devserver stays |
| 29 | +running, and when the re-build is finished, it will trigger the Livereload in |
| 30 | +the browser. |
26 | 31 |
|
27 | 32 | ```bash |
28 | | -$ bazel query --output=graph ... | dot -Tpng > graph.png |
| 33 | +$ ./node_modules/.bin/ibazel run src:devserver |
29 | 34 | ``` |
30 | 35 |
|
31 | | - |
| 36 | +This command prints a URL on the terminal. Open that page to see the demo app |
| 37 | +running. Now you can edit one of the source files (`src/lib/file.ts` is an easy |
| 38 | +one to understand and see the effect). As soon as you save a change, the app |
| 39 | +should refresh in the browser with the new content. Our intent is that this time |
| 40 | +is less than two seconds, even for a large application. |
32 | 41 |
|
33 | | - |
34 | | -## Still missing |
| 42 | +## Coming soon |
35 | 43 |
|
36 | 44 | Karma testing rules are in-progress, should be available Q4 2017 |
37 | 45 |
|
38 | 46 | Production bundling with https://github.com/bazelbuild/rules_closure/ is |
39 | 47 | underway, should be available Q4 2017 |
40 | | - |
41 | | -## Notes |
42 | | - |
43 | | -- we use Bazel to run Yarn simply to be sure we get the same versions of Node and Yarn as CI and co-workers (hermeticity FTW). You could use NPM instead |
44 | | -- a `postinstall` task in the `package.json` prepares the `node_modules` directory by running the Angular compiler on third_party libraries (such as Angular itself) since these do not ship with generated code (eg. `ngfactory`s) |
|
0 commit comments