Commit c8e1521
fix(@angular/build): workaround Vite CSS ShadowDOM hot replacement
When using the development server with the application builder (default for new projects),
Angular components using ShadowDOM view encapsulation will now cause a full page reload.
This ensures that these components styles are correctly updated during watch mode. Vite's
CSS hot replacement client code currently does not support searching and replacing `<link>`
elements inside shadow roots. When support is available within Vite, an HMR based update
for ShadowDOM components can be supported as other view encapsulation modes are now.
(cherry picked from commit e6ff801)1 parent c41529c commit c8e1521
File tree
2 files changed
+51
-30
lines changed- packages/angular/build/src
- builders/dev-server
- tools/vite/middlewares
2 files changed
+51
-30
lines changedLines changed: 41 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
409 | 410 | | |
410 | 411 | | |
411 | 412 | | |
| |||
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
436 | | - | |
| 437 | + | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
| |||
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
| 473 | + | |
472 | 474 | | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
485 | 492 | | |
486 | | - | |
| 493 | + | |
487 | 494 | | |
488 | | - | |
489 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
490 | 498 | | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
498 | 505 | | |
499 | 506 | | |
500 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
501 | 513 | | |
502 | | - | |
| 514 | + | |
| 515 | + | |
503 | 516 | | |
504 | 517 | | |
505 | 518 | | |
506 | 519 | | |
507 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
508 | 524 | | |
509 | 525 | | |
510 | 526 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
| 87 | + | |
83 | 88 | | |
84 | | - | |
| 89 | + | |
85 | 90 | | |
86 | | - | |
| 91 | + | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| |||
0 commit comments