Commit 755d2d5
refactor(ivy): remove unnecessary fac wrapper (angular#34076)
For injectables, we currently generate a factory function in the
injectable def (prov) that delegates to the factory function in
the factory def (fac). It looks something like this:
```
factory: function(t) { return Svc.fac(t); }
```
The extra wrapper function is unnecessary since the args for
the factory functions are the same. This commit changes the
compiler to generate this instead:
```
factory: Svc.fac
```
Because we are generating less code for each injectable, we
should see some modest code size savings. AIO's main bundle
is about 1 KB smaller.
PR Close angular#340761 parent 02958c0 commit 755d2d5
File tree
7 files changed
+68
-24
lines changed- aio/scripts
- integration
- packages
- compiler-cli
- ngcc
- src/analysis
- test/integration
- src/ngtsc
- test/compliance
- compiler/src
7 files changed
+68
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
208 | 238 | | |
209 | 239 | | |
210 | 240 | | |
211 | 241 | | |
212 | 242 | | |
213 | 243 | | |
214 | | - | |
| 244 | + | |
215 | 245 | | |
216 | 246 | | |
217 | 247 | | |
| |||
222 | 252 | | |
223 | 253 | | |
224 | 254 | | |
225 | | - | |
| 255 | + | |
226 | 256 | | |
227 | 257 | | |
228 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
632 | 636 | | |
633 | 637 | | |
634 | 638 | | |
635 | 639 | | |
636 | 640 | | |
637 | 641 | | |
638 | 642 | | |
639 | | - | |
640 | | - | |
641 | 643 | | |
642 | 644 | | |
643 | 645 | | |
| |||
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
| |||
342 | 340 | | |
343 | 341 | | |
344 | 342 | | |
345 | | - | |
346 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
347 | 348 | | |
348 | 349 | | |
349 | | - | |
| 350 | + | |
| 351 | + | |
350 | 352 | | |
| 353 | + | |
| 354 | + | |
351 | 355 | | |
352 | 356 | | |
353 | | - | |
354 | | - | |
| 357 | + | |
| 358 | + | |
355 | 359 | | |
356 | 360 | | |
357 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
120 | | - | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
126 | 132 | | |
127 | 133 | | |
0 commit comments