This project is mirrored from https://github.com/angular/angular.git.
Pull mirroring updated .
- Feb 09, 2024
-
-
Paul Gschwendtner authored
-
Kristiyan Kostadinov authored
The `@internal` in the comment above `ModelSignal.subscribe` ended up marking the method as internal even though it wasn't meant to be. PR Close #54357
-
Matthieu Riegler authored
The MatTooltip was missing after migrating to standalone PR Close #54326
-
Joey Perrott authored
Migrate formatting to prettier for router from clang-format PR Close #54318
-
Jessica Janiuk authored
-
Jessica Janiuk authored
-
cexbrayat authored
This updates some tests to use the public imports from `@angular/core` now that they are available, and cleans up useless imports and inaccurate names. PR Close #54334
-
Andrew Scott authored
In some situations, calling `markForCheck` can result in an infinite loop in seemingly valid scenarios. When a transplanted view is inserted before its declaration, it gets refreshed in the retry loop of `detectChanges`. At this point, the `Dirty` flag has been cleared from all parents. Calling `markForCheck` marks the insertion tree up to the root `Dirty`. If the declaration is checked again as a result (i.e. because it has default change detection) and is reachable because its parent was marked `Dirty`, this can cause an infinite loop. The declaration is refreshed again, so the insertion is marked for refresh (again). We enter an infinite loop if the insertion tree always calls `markForCheck` for some reason (i.e. `{{createReplayObservable() | async}}`). While the case above does fall into an infinite loop, it also truly is a problem in the application. While it's not an infinite synchronous loop, the declaration and insertion are infinitely dirty and will be refreshed on every change detection round. Usually `markForCheck` does not have this problem because the `Dirty` flag is not cleared until the very end of change detection. However, if the view did not already have the `Dirty` flag set, it is never cleared because we never entered view refresh. One solution to this problem could be to clear the `Dirty` flag even after skipping view refresh but traversing to children. PR Close #54329
-
Kristiyan Kostadinov authored
The `subscribe` methods on `ModelSignal` and `OutputEmitter` were marked as `@internal` which will break when the TCB needs to reference them. These changes make them `@deprecated` temporarily so we can address the properly later. PR Close #54342
-
cexbrayat authored
The new `model()` signal introduces a `ModelSignal` type that needs to be handled by the interpolatedSignalNotInvoked diagnostic to catch issues like: ``` <div>{{ myModel }}</div> ``` PR Close #54338
-
ascorbic authored
Add an image loader for Netlify Image CDN. It is slightly different in implementation from existing loaders, because it allows absolute URLs Fixes #54303 PR Close #54311
-
- Feb 08, 2024
-
-
Kristiyan Kostadinov authored
The import of `module` can conflict with the native global variable called `module` and can break some internal tests. These switch to only importing the function we need. PR Close #54333
-
Kristiyan Kostadinov authored
Fixes an internal test failure due to `FatalDiagnosticError` extending the native `Error`. PR Close #54327
-
Pawel Kozlowski authored
Introducing a tiny utility method to remove some code duplication between the change change detection and signal based queries. PR Close #54322
-
Ben Hong authored
PR Close #54161
-
Paul Gschwendtner authored
Adds usages of signal-based queries into the signal integration test to verify queries can be used in production, and testing environments as expected (i.e. the transform works as expected). PR Close #54314
-
Paul Gschwendtner authored
This helps with the Angular CLI currently swallowing fatal diagnostic errors in ways that are extremely difficult to debug due to workers executing Angular compiler logic. The worker logic, via piscina, is currently not forwarding such Angular errors because those don't extend `Error.` https://github.com/piscinajs/piscina/blob/a7042ea27d129f3cad75c422f5aa92f0663854ee/src/worker.ts#L175 Even with access to these errors by manually forwarding errors, via patching of the Angular CLI, there is no stack trace due to us not using `Error` as base class for fatal diagnostic errors. This commit improves this for future debugging and also better reporting of such errors to our users- if we would accidentally leak one. PR Close #54309
-
Paul Gschwendtner authored
An identical addition to: 760b1f3d. This commit expands the `try/catch`-es: - to properly NOT throw and just convert the diagnostic. - to be in place for all top-level instances. Notably, this logic cannot reside in the template type checker directly as otherwise we would risk multiple duplicate diagnostics. PR Close #54309
-
Kristiyan Kostadinov authored
Fixes that `ɵunwrapWritableSignal` inferring getter functions as not matching the interface of `WritableSignal` instead of preserving them. PR Close #54252
-
Kristiyan Kostadinov authored
Adds an assertion that will throw if `ModelSignal.update` is accessed before an initial value is set. PR Close #54252
-
Kristiyan Kostadinov authored
Asserts that the value is a `WritableSignal`, rather than a `Signal`, in the `twoWayProperty` instruction. PR Close #54252
-
Kristiyan Kostadinov authored
refactor(compiler-cli): fix regression in two-way bindings to inputs with different getter/setter types (#54252) In a previous commit the TCB was changed to cast the assignment to an input in order to widen its type to allow `WritableSignal`. This ended up breaking existing inputs whose setter has a wider type than its getter. These changes switch to unwrapping the value on the binding side. PR Close #54252
-
Kristiyan Kostadinov authored
Addresses the feedback from #54252. PR Close #54252
-
Kristiyan Kostadinov authored
Reworks the TCB for two-way bindings to make them simpler and to avoid regressions for two-way bindings to generic inputs. The new TCB looks as follows: ``` var _t1: Dir; var _t2 = _t1.input; (_t1 as typeof _t2 | WritableSignal<typeof _t2>) = expression; ``` PR Close #54252
-
Kristiyan Kostadinov authored
Updates the code that resolves a node from the TCB to an input in order to fix the language service. PR Close #54252
-
Kristiyan Kostadinov authored
Adds support for model inputs in the framework. `model()` returns a writable signal that implicitly defines a input/output pair that can be used either in two-way bindings to keep two values in sync or by binding individually to the input and output. When the value of the `model` changes, it will emit an event with the current value. Furthermore, these changes expand two-way bindings to accept `WritableSignal`. This will make it easier to transition existing code to signals in a backwards-compatible way. Example: ```ts @Directive({ selector: 'counter', standalone: true, host: { '(click)': 'increment()', } }) export class Counter { value = model(0); increment(): void { this.value.update(current => current + 1); } } @Component({ template: `<counter [(value)]="count"/> The current count is: {{count()}}`, }) class App { count = signal(0); } ``` PR Close #54252
-
Kristiyan Kostadinov authored
Adds tests in the compiler to verify the compiled output and template type checking behavior of model inputs. PR Close #54252
-
Kristiyan Kostadinov authored
Updates the TCB generation logic to allow for `WritableSignal` to be assigned in two-way bindings. PR Close #54252
-
Kristiyan Kostadinov authored
Sets up the runtime tests for model inputs. PR Close #54252
-
Kristiyan Kostadinov authored
Adds the logic that recognizes fields initialized to model as an input/output pair. PR Close #54252
-
Kristiyan Kostadinov authored
Adds the implementations of the `twoWayProperty` and `twoWayListener` instructions. PR Close #54252
-
Kristiyan Kostadinov authored
Adds a JIT transform that marks `model` fields as `@Input` and `@Output`. PR Close #54252
-
Kristiyan Kostadinov authored
Adds a function to the compiler to help us identify fields initialized to a `model`. PR Close #54252
-
Kristiyan Kostadinov authored
Adds the implementation of the `model` primitive that represents a two-way binding signal-based binding. PR Close #54252
-
Paul Gschwendtner authored
This commit improves IDE completion of the `read` option for signal-based queries. Currently, TS only matches the first overload when starting out with defining a query. TS doesn't build up the combination of possible options from the second overload- so in practice users will only see IDE completions for the `descendants` option. This is not a problem for view queries as the only option is `read`, so TS will always match the overload with the `read` option. ``` class X { query = contentChild('', {^^ <-- here we should completion for `read` an `descendants` } ``` PR Close #54280
-
cexbrayat authored
husky v9 simplified its setup, see `How to migrate` in https://github.com/typicode/husky/releases/tag/v9.0.1 PR Close #54315
-
- Feb 07, 2024
-
-
Jessica Janiuk authored
This reverts commit 66812928. PR Close #54317
-
Payam Valadkhan authored
fix(compiler-cli): show specific error for unresolved @Directive.exportAs in local compilation mode (#54230) Currently the error is a generic error "exportAs must be a string ...". This commit makes the error more specific to local compilation and adds some action items. PR Close #54230
-
Payam Valadkhan authored
fix(compiler-cli): show specific error for unresolved @HostBinding's argument in local compilation mode (#54230) Currently the error is a generic error "selector must be a string ...". This commit makes the error more specific to local compilation and adds some action items. PR Close #54230
-
Payam Valadkhan authored
fix(compiler-cli): show specific error for unresolved @HostListener's event name in local compilation mode (#54230) Currently the error is a generic error "selector must be a string ...". This commit makes the error more specific to local compilation and adds some action items. PR Close #54230
-