Commit 32bca25
authored
Adding incremental Frontend Server-compatible DDC builders + supporting infrastructure (#4240)
Glues FES into build_runner, which is our first step towards hot reload + build_runner.
The high level workflow is:
1) A persistently running frontend server is initialized once when a build starts.
2) build_runner requests JS files based on locally modified/generated dart files (as usual). Builders that collect meta-information about DDC modules also - as a side effect - record the main app entrypoint and any locally modified files.
3) When a JS file is requested, the frontend server receives recompile requests via a proxy queue (to maintain communication order with the frontend server).
4) The frontend server processes compilation requests and serves compiled JS files back to `build_runner` (hot-reload ready).
Major changes:
* Adds a `DdcFrontendServerBuilder` to our set of DDC builders (enabled via the `web-hot-reload` config). This builder keeps a `PersistentFrontendServer` instance alive across rebuilds. Compile/recompile requests are queued via a `FrontendServerProxyDriver` resource.
* Uses `scratch_space` to record both 1) the main app entrypoint and 2) updated local files from the `entrypoint_marker` builder and the `module_builder` builder respectively. These are side effects that break certain stateful 'guarantees' of standard build_runner execution. The `entrypoint_marker` builder runs before any of the downstream DDC builders and finds the web entrypoint, as Frontend Server must receive the same entrypoint on every compilation request.
* Requires that strongly connected components in both the frontend server and `build_runner` be disabled.
Test changes:
* Extends `build_test` to permit incremental builds. This involves passing the asset graph + asset reader/writer across build results and only performing cleanup operations after a series of rebuilds.
* `build_test` doesn't support `runs_before` and other ordering rules in `build.yaml`, so the above changes allows a kind of imperative ordering, which is important for testing `entrypoint_marker`.
Minor changes:
* Added a flag to disable strongly connected components in build_web_compilers (implemented using raw ddc meta-modules over clean ddc meta-modules + enforcing fine module aggregation).
* Added disposal logic to `scratch_space` so that rebuilds only retain modified files.
* Updated `scratch_space` `package_config.json` specs (`packageUri` and `rootUri`). The previous values didn't seem to make sense to me, but I'm also not familiar with how that's standardized in `scratch_space`.
* Added `file` and `uuid` deps to `build_modules`.
* Moved around some helper functions.
* Ported some naming functions from the DDC runtime.1 parent 6988984 commit 32bca25
File tree
37 files changed
+2271
-220
lines changed- build_modules
- lib
- src
- test
- build_runner/test
- common
- integration_tests
- build_web_compilers
- lib
- src
- test
- scratch_space
- lib/src
37 files changed
+2271
-220
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | | - | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | | - | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
19 | 33 | | |
20 | 34 | | |
21 | 35 | | |
| |||
Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 38 | + | |
| 39 | + | |
43 | 40 | | |
| 41 | + | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
82 | | - | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
0 commit comments