Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/angular/angular.git. Pull mirroring updated .
  1. Aug 15, 2024
  2. Aug 14, 2024
  3. Aug 13, 2024
    • Paul Gschwendtner's avatar
      refactor(migrations): handle `jit: true` component templates in signal input migration (#57347) · d608b857
      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
      d608b857
    • Paul Gschwendtner's avatar
      refactor(migrations): expose angular compiler options to signal input migration (#57347) · 310a0e0e
      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
      310a0e0e
    • Paul Gschwendtner's avatar
      refactor(migrations): handle safe property reads in signal input migration (#57318) · 52673e64
      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
      52673e64
    • Paul Gschwendtner's avatar
      perf(migrations): speed up signal input migration by combining two analyze phases (#57318) · 6b7b44db
      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
      6b7b44db
    • Paul Gschwendtner's avatar
      refactor(migrations): use import manager in signal input migration (#57318) · fc4c9baf
      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
      fc4c9baf
    • Paul Gschwendtner's avatar
      refactor(migrations): add best effort mode to signal input migration (#57318) · 62ec4675
      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
      62ec4675
    • Paul Gschwendtner's avatar
      refactor(migrations): add initial docs for signal input migration incompatibility reasons (#57318) · f7fa70ee
      Paul Gschwendtner authored
      Adds a markdown document capturing some of the incompatibilty reasons
      on why the input wasn't migrated.
      
      PR Close #57318
      f7fa70ee
    • Andrew Scott's avatar
      fix(core): rethrow errors during ApplicationRef.tick in TestBed (#57200) · 468d3fb9
      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
      468d3fb9
    • Angular Robot's avatar
      build: lock file maintenance (#57340) · 24cd1c8d
      Angular Robot authored
      See associated pull request for more information.
      
      PR Close #57340
      24cd1c8d
    • Matthieu Riegler's avatar
      docs(docs-infra): fix marked rendering (#57338) · 360979f3
      Matthieu Riegler authored
      Follow-up to #57319 which introduced some regressions after updating marked to v14
      
      PR Close #57338
      360979f3
    • Andrew Scott's avatar
      fix(router): Align RouterModule.forRoot errorHandler with provider error handler (#57050) · b2790813
      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
      b2790813
    • Andrew Scott's avatar
      fix(router): Update Resolve interface to include RedirectCommand like ResolveFn (#57309) · 7436d318
      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
      7436d318
  4. Aug 10, 2024
  5. Aug 09, 2024
  6. Aug 08, 2024