This project is mirrored from https://github.com/angular/angular.git.
Pull mirroring updated .
- Aug 15, 2024
-
-
Andrew Kushnir authored
-
Andrew Kushnir authored
-
Andrew Kushnir authored
-
- Aug 14, 2024
-
-
Matthieu Riegler authored
fixes #57376 PR Close #57377
-
Thomas Nguyen authored
refactor(core): Add experimental support to have one event contract when there are multiple apps on the page. (#57355) This may be removed if this turns out not to work out so well... PR Close #57355
-
Thomas Nguyen authored
refactor(core): Call stopPropagation and preventDefault unconditionally within the patched methods. (#57354) This fixes a few tests in g3 and is a bug fix for the event dispatcher. Otherwise, bubbling might continue. PR Close #57354
-
Thomas Nguyen authored
This happened to work for other event listeners since both had a addEventListener method. PR Close #57354
-
Matthieu Riegler authored
PR Close #57255
-
Andrew Scott authored
This commit updates the search results to query for the content as well as a snippet of the content for display when it's the content that matches the query rather than any of the headers. PR Close #57298
-
Kristiyan Kostadinov authored
Updates the logic that generates new component properties to avoid duplicating their doc strings. PR Close #57367
-
Kristiyan Kostadinov authored
Makes it so the inject migration preserves the optional token when declaring a parameter. This came up in some testing as something that can be potentially breaking for classes that implement interfaces. PR Close #57367
-
Andrew Kushnir authored
This commit fixes an issue that happens when an i18n block is defined as a projectable content, but a parent component doesn't project it. With an extra check added in this commit, the code will be taking a regular "creation" pass instead of attempting hydration. Resolves #57301. PR Close #57356
-
Paul Gschwendtner authored
Signal inputs are no longer updated by assignment, unlike `@Input()`, so a good practice is adding `readonly` for the `InputSignal`— which should never be swapped out. This is a safe operation because the migration skips all inputs that are being written anyway. PR Close #57368
-
Paul Gschwendtner authored
In some cases, the migration can detect when `input()` as a shorthand may be usable. This commit adds such detection and migrates inputs to this form when possible. PR Close #57368
-
Angular Robot authored
See associated pull request for more information. PR Close #57357
-
Angular Robot authored
See associated pull request for more information. PR Close #57358
-
Angular Robot authored
See associated pull request for more information. PR Close #57191
-
- Aug 13, 2024
-
-
Paul Gschwendtner authored
Components with `jit: true` are not processed by the Angular compiler, so we cannot ask the template checker for the parsed template; simply because the template wasn't attempted to be parsed. We still can migrate simple cases of such components, commonly seen in unit tests. We do this by manually parsing the template and making use of the reference fallback resolution that is also used for host bindings (where we don't have any type check block information). PR Close #57347
-
Paul Gschwendtner authored
Instead of exposing just the `ts.CompilerOptions`, we should expose the actual Angular compiler options throuhgout the signal input migration. This will be useful for parsing templates, in cases of JIT-opted components. PR Close #57347
-
Paul Gschwendtner authored
As of this commit, the migration will also inspect safe property reads and migrate them, if they reference an input that is being migrated. PR Close #57318
-
Paul Gschwendtner authored
Instead of revisiting each source file, and each of its child nodes twice, we now visit them together using a grouped AST visitor that only traverses each source file once. This seemed to speed up migration by 6-8% locally, but is likely noticable better with large compilation scopes. PR Close #57318
-
Paul Gschwendtner authored
Instead of fiddling manually with the imports, which worked well, but comes at a cost of complexity— we are now using the canonical import manager. This simplifies deletion, insertion and updating of imports. Notably, our import manager is not super great at preserving whitespaces right now, but we assume a formatter runs over migrated code anyway. PR Close #57318
-
Paul Gschwendtner authored
Introduces a best effort mode for the signal input migration. This mode can be used to aggresively migrate as much as possible, ignoring most of the incompatibility reasons, like "writes to the input". PR Close #57318
-
Paul Gschwendtner authored
Adds a markdown document capturing some of the incompatibilty reasons on why the input wasn't migrated. PR Close #57318
-
Andrew Scott authored
Errors during change detection from `ApplicationRef.tick` are only reported to the `ErrorHandler`. By default, this only logs the error to console. As a result, these errors can be missed/ignored and allow tests to pass when they should not. This change ensures that the errors are surfaced. Note that this is already the behavior when zoneless is enabled. BREAKING CHANGE: Errors that are thrown during `ApplicationRef.tick` will now be rethrown when using `TestBed`. These errors should be resolved by ensuring the test environment is set up correctly to complete change detection successfully. There are two alternatives to catch the errors: * Instead of waiting for automatic change detection to happen, trigger it synchronously and expect the error. For example, a jasmine test could write `expect(() => TestBed.inject(ApplicationRef).tick()).toThrow()` * `TestBed` will reject any outstanding `ComponentFixture.whenStable` promises. A jasmine test, for example, could write `expectAsync(fixture.whenStable()).toBeRejected()`. As a last resort, you can configure errors to _not_ be rethrown by setting `rethrowApplicationErrors` to `false` in `TestBed.configureTestingModule`. PR Close #57200
-
Angular Robot authored
See associated pull request for more information. PR Close #57340
-
Matthieu Riegler authored
Follow-up to #57319 which introduced some regressions after updating marked to v14 PR Close #57338
-
Andrew Scott authored
This change aligns the behavior of the error handler in the `ExtraOptions` of `RouterModule.forRoot` with the error handler in `withNavigationErrorHandler`. The changes are: * Slightly different timing: The handler is called before the `NavigationError` emits * Runs in the injection context, meaning it is more configurable at the config location rather than needing to assign the value to the `Router.errorHandler` later to get access to injectables * Can now return `RedirectCommand` to recover from the error and redirect without emitting `NavigationError` * No longer allows arbitrarily overriding return value of the navigation promise BREAKING CHANGE: The `Router.errorHandler` property has been removed. Adding an error handler should be configured in either `withNavigationErrorHandler` with `provideRouter` or the `errorHandler` property in the extra options of `RouterModule.forRoot`. In addition, the error handler cannot be used to change the return value of the router navigation promise or prevent it from rejecting. Instead, if you want to prevent the promise from rejecting, use `resolveNavigationPromiseOnError`. PR Close #57050
-
Andrew Scott authored
This commit updates the interface of `Resolve` to allow for `RedirectCommand`, as was done with `ResolveFn` in v18. fixes #57131 BREAKING CHANGE: The return type of the `Resolve` interface now includes `RedirectCommand`. PR Close #57309
-
- Aug 10, 2024
-
-
Gilad Mautner authored
PR Close #57307
-
- Aug 09, 2024
-
-
Andrew Scott authored
This commit adds an input to `RouterOutlet` that allows developers to pass data from a parent component to the outlet components. Setting the `routerOutletData` input on `RouterOutlet` makes the value available to the child component injectors via the `ROUTER_OUTLET_DATA` token. This token uses a `Signal` type to allow updating the input value and propogating it to the token rather than needing to make the value static. resolves #46283 PR Close #57051
-
Andrew Kushnir authored
This commit updates serialization and hydration i18n logic to take into account situations when i18n blocks are located within "skip hydration" blocks. Resolves #57105. PR Close #57299
-
Andrew Kushnir authored
Previously, if a component injects a `ViewContainerRef`, the post-hydration cleanup process doesn't visit inner views to cleanup dehydrated views in nested LContainers. This commit updates the logic to recognize this situation and enter host LView to complete cleanup. Resolves #56989. PR Close #57300
-
Paul Gschwendtner authored
By default, we don't migrate inputs if they are part of e.g. `@if` for now. That is because we don't have the template narrowing feature available yet. To improve impact of the migration until we have the narrowing, we add some additional checks that allow us to migrate instances of inputs that are part of e.g. `@if` but are actually not used inside (and hence are guaranteed to be _not_ narrowed). PR Close #57308
-
Angular Robot authored
See associated pull request for more information. Closes #57283 as a pr takeover PR Close #57319
-
Kristiyan Kostadinov authored
Expands the `inject` migration to add some cleanups that are only relevant internally. Externally this isn't exposed to users. PR Close #57315
-
Paul Gschwendtner authored
PR Close #57314
-
Andrew Scott authored
This commit updates the inside/outside NgZone detection of the hybrid CD scheduling to track the actual instance of the NgZone being used rather than the name "Angular" (how `isInsideAngularZone` works). This allows the scheduling to work correctly when there are multiple versions of Angular running on the page. fixes #57261 PR Close #57267
-
- Aug 08, 2024
-
-
Thomas Nguyen authored
This happened to work for other event listeners since both had a addEventListener method. PR Close #57282
-
Kristiyan Kostadinov authored
Currently in some scenarios the compiler generates code like `null as any ? foo : bar` which will be invalid with [an upcoming TypeScript change](https://devblogs.microsoft.com/typescript/announcing-typescript-5-6-beta/#disallowed-nullish-and-truthy-checks). These changes switch to generating `0 as any` which is exempt from the change. **Note:** I'm not starting the work to fully get us on TS 5.6 until the 18.2 release comes out, but this change is necessary to unblock an internal team. PR Close #57303
-