https://github.com/angular/angular

sort by:
Revision Author Date Message Commit Date
881376e release: cut the v17.1.0-rc.0 release 10 January 2024, 22:25:36 UTC
3877635 docs: release notes for the v17.0.9 release 10 January 2024, 22:13:54 UTC
863be4b feat(core): expose new `input` API for signal-based inputs (#53872) Enables signal inputs for existing Zone based components. This is a next step we are taking to bring signal inputs earlier to the Angular community. The goal is to enable early access for the ecosystem to signal inputs, while we are continuing development of full signal components as outlined in the RFC. This will allow the ecosystem to start integrating signals more deeply, prepare for future migrations, and improves code quality and DX for existing components (especially for OnPush). Based on our work on full signal components, we've gathered more information and learned new things. We've improved the API by introducing a way to intuitively declare required inputs, as well as improved the API around initial values. We even support non-primitive initial values as the first argument to the `input` function now. ```ts @Directive({..}) export class MyDir { firstName = input<string>(); // string|undefined lastName = input.required<string>(); // string age = input(0); // number ``` PR Close #53872 10 January 2024, 20:33:31 UTC
b2066d4 refactor(compiler-cli): detect input functions without partial evaluation (#53872) This allows us to ensure signal inputs and a potential JIT transform remain single file compilation compatible. The consequences are that options need to be statically analyzable more strictly, compared to loosened restrictions with static interpretation where e.g. `alias` can be defined through a shared variable. PR Close #53872 10 January 2024, 20:33:31 UTC
f6a32c0 docs: fix & update apf links to pkg examples (#53866) PR Close #53866 10 January 2024, 18:43:54 UTC
7862686 test(core): add acceptance unit tests for signal inputs (#53808) Adds AOT and JIT unit tests for signal inputs that verify integration of signal inputs for our users. PR Close #53808 10 January 2024, 12:21:06 UTC
74099a3 test: add infrastructure to run signal acceptance tests with JIT and AOT (#53808) Adds infrastructure to run signal input tests with JIT (using the transform) and AOT. Acceptance tests for signal inputs will run with both variants. In the future we can consider expanding this infrastructure for all of our acceptance tests, but that's a different story. PR Close #53808 10 January 2024, 12:21:06 UTC
39ea8b3 refactor(compiler-cli): drop dependency on external modules for input recognition (#53808) Improves the recognition of the `input`/`input.required` functions to not depend on external module resolution. This is useful for local compilation and for transforms operating on a single file/ isolated module. PR Close #53808 10 January 2024, 12:21:06 UTC
e934f3a refactor(compiler-cli): add diagnostic for inputs declared on static members (#53808) Currently when someone declares a signal or non-signal input on a static class member, the compiler will not yield any diagnostic. We can detect these mistakes and report a diagnostic to help our users. PR Close #53808 10 January 2024, 12:21:06 UTC
40b0467 refactor(compiler-cli): diagnostics ensuring signal inputs are declared properly (#53808) This commit addds two diagnostics for two scenarios where signal inputs are declared incorrectly: - a signal input is also annotated with `@Input` in the TypeScript sources. - a signal input is also declared in the `inputs` option of `@Directive/`@Component`. PR Close #53808 10 January 2024, 12:21:05 UTC
4906ba7 test: add completion tests for language service with signal inputs (#53808) Given that the TCB output changes with signal inputs, and one of our important considerations was auto-completion, we need some unit tests that verify and guarantee proper completion with signal inputs being bound in templates. This commit adds these. PR Close #53808 10 January 2024, 12:21:05 UTC
81379ef refactor(compiler-cli): follow-up typo fixes for typecheck utilities (#53808) Follow-up for the inital signal inputs PR, fixing a typo that was made. PR Close #53808 10 January 2024, 12:21:05 UTC
eba017f refactor(compiler-cli): add transform to support signal input in JIT (#53808) This commit adds a transform for supporting input signals in JIT environments. The transform will be wired up for Angular CLI applications automatically. An integration test verifies that this fixes unit testing with signal inputs. The transform basically will take the signal input metadata and transform it into `@Input` decorators that can provide static information to the Angular JIT runtime when the directive/component definition is compiled. PR Close #53808 10 January 2024, 12:21:05 UTC
b51f386 refactor(compiler-cli): expose import manager import insertion helper (#53808) This commit does two things: - exposes `addImports` so that it can be used by transforms that we are adding to the compiler. e.g. the signal input to `@Input` transform. - `updates `addImports` to support/use the transform context factory. This will allow us to write proper transforms using `addImports`. Also leverages this in the Ivy JS/DTS transforms. PR Close #53808 10 January 2024, 12:21:05 UTC
4c53668 refactor(compiler-cli): expose helper for parsing signal input class members (#53808) Moves the signal input class member extraction logic into the dedicated input function file. This makes the code for signal inputs more self-contained. This commit then re-exposes the function as part of `ngtsc/annotations` so that it can be used later for a transform that will take the signal input metadata and translate it into a `@Input` decorator. This allows us to remove code duplication and guarantees consistency/correctness PR Close #53808 10 January 2024, 12:21:05 UTC
82a1ce0 test(compiler-cli): add additional diagnostic test for generic inline constructors (#53808) We recently landed a commit to introduce support for generic type checking of signal inputs. For that we had to implement logic that will generate imports for inline type constructors. This required changes to the context logic and `TypeCtorOp` file-level op. This commit ensures that everything is working as expected, specifically in cases where an inline type ctor is generated and imports would be needed to unwrap the class members for `InputSignal`. PR Close #53808 10 January 2024, 12:21:05 UTC
55b202f test(core): add test playground for zone signal inputs (#53808) This commit creates a small http server Angular application playground for playing with signal inputs. This is useful for development and also validates some of the common input patterns. PR Close #53808 10 January 2024, 12:21:05 UTC
977884a test(core): add runtime tests for input signal (#53808) This commit adds some runtime unit tests to ensure that input signal is behaving properly at runtime. PR Close #53808 10 January 2024, 12:21:05 UTC
1df95cd refactor(core): improve error message and add guide for required inputs (#53808) Whenever a required input is accessed too early in a directive/component, the signal input will throw an error. This is necessary so that we can support required inputs with intuitive typings that do not include `undefined` for the short period of time where Angular is creating the component and then assigning inputs later (Angular currently has no way of setting inputs as part of the class creation when `new Dir()` happens) PR Close #53808 10 January 2024, 12:21:05 UTC
7f5ae52 test: add integration test for signal inputs in CLI (#53808) This commit introduces a new integration test to ensure signal inputs work as expected for end uses in Angular CLI applications. PR Close #53808 10 January 2024, 12:21:05 UTC
4a01688 test: add signal input compliance tests for linking, partial output and full compilations (#53808) Adds signal input compliance tests, ensuring linking works as expected, partial output is generated properly, types are inferred properly, and that the full, or linked output matches our expected runtime structure. PR Close #53808 10 January 2024, 12:21:05 UTC
4b49410 refactor(compiler-cli): support linking/parsing new partial output for signal inputs (#53808) As we introduced the new partial output for signal inputs, we also need to update the linker code to be able to parse this. This commit adds this functionality. In the follow-up commit, compliance tests for linking, partial output, and full compilations are added. PR Close #53808 10 January 2024, 12:21:05 UTC
d714750 refactor(core): properly emit input flags using bitwise or (#53808) As part of testing we did accidentally use `bitwiseAnd` for the input flags, given we started without an extra flag for `HasTransform`. This commit teaches the compiler to support emitting bitwise OR and uses it when combining input flags, fully re-enabling transforms for signal components after the new flag mechanism was introduced in previous commits. PR Close #53808 10 January 2024, 12:21:04 UTC
cfab5a5 refactor(core): detect signal input transforms independently of flag (#53808) This commit changes the `HasTransform` flag to be only concerned with decorator inputs. This allows us to automatically detect signal input transforms without reliance on the flag, resulting in less complexity in the compiler (as outlined in the design doc) and various other places, while it also allows us to simplify JIT support for signal inputs because there would be no need to capture the "hasTransform" state in the decorator so that JIT can generate the according input flags. `isSignal` will still persist as an input flag to allow for monomorphic and highly efficient distinguishing at runtime, whether an input is signal based or not. JIT transform will also need to propagate this information to the runtime somehow. PR Close #53808 10 January 2024, 12:21:04 UTC
eee0af0 refactor(core): add internal signal input support for `@Input` decorator (#53808) We are adding internal support for declaring signal inputs via the `@Input` decorator. This is needed for JIT unit testing, or JIT applications. In JIT, Angular is not able to recognize signal inputs due to the lack of static reflection metadata. Decorators attach their information on the class- without it needing to be instantiated. This allows Angular to know inputs when preparing/generating the directive definition. With signal inputs this is not possible- so we need a way to tell Angular about inputs for JIT applications. We've decided that this is not something users should have to deal with, so a transform will be added in a follow-up that will automatically derive/and add the decorators for signal inputs when requested in JIT environments. PR Close #53808 10 January 2024, 12:21:04 UTC
6fcfe2b build: fix partial output generation errors swallowed (#53808) In some cases, the input files for a partial output generation compliance tests may be invalid and lead to compilation errors. The golden partial would be silently generated with the remaining test cases. Instead of hiding errors, we will now print these and cause the script to fail properly. Note that the error logging is pretty minimalistic, but it's sufficient. PR Close #53808 10 January 2024, 12:21:04 UTC
05ed60a refactor(compiler-cli): improve type safety of linker AST (#53808) The linker AST is abstracted to be agnostic of the underlying implementation AST. i.e. TS AST or Babel AST. This abstraction also intends to provide some type-safety-ness to parsing of various partial declarations. This commit improves type safety further by fixing that `AstValue'`s were not checked for assignability of `T`- potentially hiding issues/unaccounted values. Additionally, we fix that `getObject()` does not properly narrow union types to actual object literals. This happend because e.g. arrays are of type `object`. We can improve type safety here. Using `Record` did not help as an array would still assign to that. PR Close #53808 10 January 2024, 12:21:04 UTC
5978b3d refactor(core): Move change detection scheduler implementation to core (#53579) This commit moves the implementation of the change detection scheduler used for testing to angular/core along with a (private export) provider function. Note: Naming of the provider function is absolutely not final (and not public API). I would prefer one that did not mention "zones" but the easiest thing for now is to have a "Zone" and "Zoneless" naming scheme. PR Close #53579 10 January 2024, 00:05:32 UTC
60dfcc2 test(core): Add scheduler in tests to tie into `ApplicationRef.isStable` (#53579) This commit updates the test scheduler implementation to contribute to ApplicationRef stableness. PR Close #53579 10 January 2024, 00:05:31 UTC
c2dd703 refactor(core): Remove internal-only testability features (#53767) This commit removes the testability features that are internal only. This simplifies the implementation of testability which will need updates to support zoneless. Those updates will be easier to manage if the Testability implementation is simpler. While protractor is indeed officially EOL, we will still need to do some updates to support teams migrating to zoneless that have protractor tests. As far as protractor's own use of `whenStable`, it does not read the internal only methods either: https://github.com/angular/protractor/blob/master/lib/clientsidescripts.js Anything else depending on these values are not following the defined public API contract. PR Close #53767 09 January 2024, 22:46:46 UTC
5996d3f Revert "refactor(router): Update integration tests to cover navigation and history API (#53799)" (#53860) This reverts commit eb2e879a008adebe11d63f42799570ba4f053c52. PR Close #53860 09 January 2024, 22:30:50 UTC
acf1793 refactor(zone.js): delete zone.js externs (#53445) Externs were used for Closure Compiler. Users have moved on to other bundlers like Webpack, esbuild, etc. Externs are no longer needed. PR Close #53445 09 January 2024, 21:20:51 UTC
0dad149 refactor(zone.js): change from scripts to modules (#53445) Make Zone.js compatible with moduleDetection:force by turning files that are currently incompatible from scripts into modules using an empty export statement. PR Close #53445 09 January 2024, 21:20:50 UTC
eb2e879 refactor(router): Update integration tests to cover navigation and history API (#53799) This commit updates the router integration tests to cover both the classic History and the new Navigation API. There is more work to be done here, but this commit works to prove the efficacy of the `FakeNavigation` implementation. PR Close #53799 09 January 2024, 20:56:47 UTC
2dedc4a fix(compiler): generate less code for advance instructions (#53845) We generate `advance` instructions before most update instructions and the majority of `advance` calls are advancing by one. We can save some bytes for the most common case by omitting the parameter for `advance(1)` altogether. PR Close #53845 09 January 2024, 20:27:58 UTC
09baed0 refactor(core): remove signal mutate implementation (#52348) It's not used anymore. PR Close #52348 09 January 2024, 20:23:07 UTC
2d7d4e2 refactor(core): type-safe global ng (#53439) This PR provides strict type definition for the window.ng object used for both console debugging and devtools. `GlobalDevModeUtils` now gathers all type information about all methods exposed on window.ng. PR Close #53439 09 January 2024, 20:17:48 UTC
e733056 ci: add adev to ci (#53833) Add adev job to CI to ensure it continues to build as expected PR Close #53833 09 January 2024, 20:15:59 UTC
7ff44f9 docs(docs-infra): wrong URL for Unicode CLDR fixed (#53785) fixes wrong URLs for Unicodde CLDR Fixes #53734 PR Close #53785 09 January 2024, 20:13:11 UTC
d0b95d5 fix(migrations): Fix empty switch case offset bug in cf migration (#53839) This addresses the offset issue caused when a switch case was empty with no spaces or children being affected by the markers that were added, but not accounted for in offset. The markers are not needed for empty content and can be safely removed in this case. fixes: #53779 PR Close #53839 09 January 2024, 20:09:38 UTC
a468a5e release: cut the zone.js-0.14.3 release (#53630) PR Close #53630 09 January 2024, 17:10:02 UTC
e2b5988 refactor(core): node removal should notify the scheduler (#53812) This commit ensures that change detection runs when an `LView` is removed. Change detection is required because DOM nodes aren't actually removed until the animation engine flushes and this doesn't happen until the end of `detectChangesInternal` (`rendererFactory.end`). PR Close #53812 09 January 2024, 16:51:30 UTC
1be6b0a fix(common): remove unused parameters from the ngClass constructor (#53831) Remove unused parameters which were only being kept because of a downstream usage in flex layout which is deprecated and end of life PR Close #53831 08 January 2024, 22:38:50 UTC
f7c02e1 fix(docs-infra): include the homepage playground content (#53832) Include the homepage playground content in the homepage PR Close #53832 08 January 2024, 19:33:17 UTC
4a87a8a build: update cross-repo angular dependencies (#53836) See associated pull request for more information. PR Close #53836 08 January 2024, 19:31:57 UTC
dfcf0d5 fix(core): `afterRender` hooks now only run on `ApplicationRef.tick` (#52455) The `afterRender` hooks currently run after `ApplicationRef.tick` but also run after any call to `ChangeDetectorRef.detectChanges`. This is problematic because code which uses `afterRender` cannot expect the component it's registered from to be rendered when the callback executes. If there is a call to `ChangeDetectorRef.detectChanges` before the global change detection, that will cause the hooks to run earlier than expected. This behavior is somewhat of a blocker for the zoneless project. There is plenty of application code that do things like `setTimeout(() => doSomethingThatExpectsComponentToBeRendered())`, `NgZone.onStable(() => ...)` or `ApplicationRef.onStable...`. `ApplicationRef.onStable` is a should likely work similarly, but all of these are really wanting an API that is `afterRender` with the requirement that the hook runs after the global render, not an individual CDRef instance. This change updates the `afterRender` hooks to only run when `ApplicationRef.tick` happens. fixes #52429 fixes #53232 PR Close #52455 08 January 2024, 19:30:27 UTC
a5a9b40 feat(router): Add transient info to RouterLink input (#53784) This is a follow up to https://github.com/angular/angular/commit/5c1d4410298e20cb03d7a1ddf7931538b6a181b4 which added the `info` property to navigation requests. `RouterLink` now supports passing that transient navigation info to the navigation request. This info object can be anything and doesn't have to be serializable. One use-case might be for passing the element that was clicked. This might be useful for something like view transitions. In the "animating with javascript" example from the blog (https://stackblitz.com/edit/stackblitz-starters-cklnkm) those links could have done this instead of needing to create a separate directive that tracks clicks. PR Close #53784 05 January 2024, 19:28:31 UTC
91f250d build: configure cross-pkg resolution for api extraction (#52499) This commit adds path mapping and source dependencies necessary to fully resolve types during api doc extraction. PR Close #52499 05 January 2024, 19:27:34 UTC
5e84d9c refactor(router): replace `last` helper with native `Array.at(-1)` (#53749) We now have a native method to return the last item of an array PR Close #53749 04 January 2024, 21:58:17 UTC
b7a717e refactor(router): replace `Object.keys` with `Object.entries` where useful. (#53745) `Object.entries` wasn't supported when those lines were written. PR Close #53745 04 January 2024, 21:57:22 UTC
a27da86 docs: remove state of js 2023 banner (#53798) PR Close #53798 04 January 2024, 21:56:20 UTC
f4bd5a3 fix(platform-server): Do not delete global Event (#53659) This commit removes a hack that deletes `Event` from the global context when using domino. Instead, it sets the global event to domino's implementation of `Event`. PR Close #53659 04 January 2024, 20:51:22 UTC
36318db refactor(compiler-cli): reference `InputFlags` enum directly for full compiler output (#53571) Instead of computing the bit input flags at compile-time and inling the final bit flag number, we will use the `InputFlags` enum directly. This is a little more code in the compiler side, but will allow us to have better debuggable development code, and also prevents problems where runtime flag bitmasks differ from the compiler flag bitmasks. This is in practice a noop for optimized applications as the enum values would be inlined anyway. This matches existing compiler emit for e.g. change detection strategy, or view encapsulation enums. PR Close #53571 04 January 2024, 20:07:13 UTC
56ff046 build: re-enable linker compliance tests (#53571) The linker compliance tests were disabled with a Babel update and nobody realized for quite a while, via https://github.com/angular/angular/pull/49914. As we've came across this lost coverage, which also is quite impactful as all libraries depend on linked output- I've took initiative to debug the root cause as there was no follow-up. https://github.com/angular/angular/issues/51647. It turned out to be a highly complex issue that is non-trivial to fix, but at least we should try to resurrect the significant portion of test coverage by still running the linker tests- avoiding regressions, or unexpected issues (like with defer being developed). We can work on re-enabling and fixing source-maps separately. Tracked via https://github.com/angular/angular/issues/51647. PR Close #53571 04 January 2024, 20:07:13 UTC
56ce8da test: fix linker compliance tests after not running for a while (#53571) The linker compliance tests did not run for a while. There were a couple of new tests that were not passing as this wasn't flagged on CI. This commit fixes this. Fortunately there was no problematic code that did indicate issues with linking. In the follow-up commit, we fix the compliance test infrastructure to re-enable linker testing.. One clear issue is still that the defer blocks are not handled properly in linked output- hence making defer not actually "lazy" for compiled libraries. This needs to be handled separately by the framework team. PR Close #53571 04 January 2024, 20:07:13 UTC
659b921 test(compiler-cli): add ngtsc test for new signal input API (#53571) This commit adds a final test for input signals, integrating all major parts: * type-checking * compiler detection * compiler emit * API signature tests PR Close #53571 04 January 2024, 20:07:13 UTC
4e2f0b7 test(core): add type signature test for signal input API (#53571) Adds tests that allow us to ensure that the `input` API works as expected and that resulting return types match our expectations- without silently regressing in the future, or missing potential edge-cases. Testing signatures is hard because of covariance and contravariance, especially when it comes to the different semantics of `ReadT` and `WriteT` of input signals. We enable reliable testing by validating the `d.ts` of the "fake directive class". This ensures clear results, compared to relying on e.g. type assertions that might accidentally/silently pass due to covariance/contravariance or biavariance in the type system. PR Close #53571 04 January 2024, 20:07:13 UTC
c948128 refactor(core): type `EMPTY_OBJ` as `never` for improved type safety (#53571) Consider a snippet like: ``` const x = directiveDef.inputs || EMPTY_OBJ ``` this currently results in `x` being inferred as just `{}`- ending up turning of potential future assignment checks. This surfaced in the `DirectiveDefinition` -> `DirectiveDef` conversion. Note: This has the effect that assigning `EMPTY_OBJ` to a field of anything would _always_ pass. It's questionable if this rather impacts type-safety in a more negative way. There seem to be trade-offs in both ways... Maybe worth considering just using `{}` directly as fallbacks in some places, and treating this as an unique symbol?! https://www.typescriptlang.org/play?#code/MYewdgzgLgBAHgLhmApgNxQJxgXhgbwF8YBDCZdLAbgCgbRJYAHJfGmDmAGxC6SkwBXFABoahAD6CwAExQAzAJaoZuZIK5dS5EmACeteuGgxBapjAkT4VIA PR Close #53571 04 January 2024, 20:07:13 UTC
1d95a83 refactor(core): detect signal inputs at runtime using input flags (#53571) This commit introduces a new enum for capturing additional metadata about inputs. Called `InputFlags`. These will be built up at compile time and then propagated into the runtime logic, in a way that does not require additional lookup dictionaries data structures, or additional memory allocations for "common inputs" that do not have any flags. The flags will incorporate information on whether an input is signal based. This can then be used to avoid megamorphic accesses when such input is set- as we'd not need to check the input field value. This also avoids cases where an input signal may be used as initial value for an input (as we'd not incorrectly detect the input as a signal input then). The new metadata emit will be useful for incorporating additional metadata for inputs, such as whether they are required etc (although required inputs are a build-time only construct right now- but this is a good illustration of why input flags can be useful). An alternative could have been to have an additional boolean entry for signal inputs, but allocating a number with more flexible input flags seems more future proof and more reasonable andreadable. More information on the megamorphic access when updating an input signal https://docs.google.com/document/d/1FpnFruviKb6BFTQfMAP2AMEqEB0FI7z-3mT_qm7lzX8/edit. PR Close #53571 04 January 2024, 20:07:13 UTC
32f908a fix(core): do not accidentally inherit input transforms when overridden (#53571) Currently when a base class defines an input with a transform, derived classes re-defining the input via `@Input`, or `inputs: [<..>]`, end up inherting the transform due to a bug in the inherit definitions feature. This commit fixes this. We verified in the Google codebase that this is an unlikely occurrence and it's trivial to fix on user side by removing the re-declaration/override, or explictly adding the necessary transform. Conceptually, the behavior was quite inconsistent as everything else of inputs was overridden as expected. i.e. alias, required state etc. The exception were input transforms. This commit fixes this. PR Close #53571 04 January 2024, 20:07:13 UTC
560ae24 refactor(core): initial test code for `setInput` to work with input signals (#53571) At this point, we have the following pieces in place: * the input signature is implemented * the compiler properly parses and recognizes signal inputs * the compiler supports type-checking of signal inputs * input signal metadata is passed to partial output This commit adds a naive runtime solution to distinguishing between signal inputs and decorator inputs when the `property` instruction invokes. This is not ideal and non-performant as we introduce additional megamorphic reads for every property instruction invocation, or if we'd use `instanceof`, introducing a hard dependency on `InputSignal` and risking potentially slower detection. This code exists purely for testing, to enable playing with input signals in the playground. In a future commit, we will pass around the input signal metadata at runtime and can perform highly optimized checks to distinguish between signal or non-signal inputs- when assigning values. More information: https://docs.google.com/document/d/1FpnFruviKb6BFTQfMAP2AMEqEB0FI7z-3mT_qm7lzX8/edit#heading=h.oloxympe902x PR Close #53571 04 January 2024, 20:07:13 UTC
7fb4a37 refactor(core): introduce runtime `InputSignal` implementation (#53571) This commit introduces the runtime `InputSignal` implementation. Input initializers using `input` or `input.required` will result in an instance of `InputSignal` to be created. An input signal extends the signal primtive, with a couple of small differences: - it's a readonly signal. There is no public `set` or `update`. - equality is non-configurable. As per CD semantics, the value is guaranteed to be different when the `property` instruction attempts to update an input signal. - we support a `transform` function, that allows transforming input values. The transform is called whenever the input is set. An alternative could have been to follow computed-semantics and call the transform upon accessing, if dirty. In the future, we might change this to extend the computed reactive node, so that we can support computed inputs that do not rely on continious bound value assignments. See signal based components RFC. PR Close #53571 04 January 2024, 20:07:13 UTC
caf3eec refactor(core): expose `SIGNAL_NODE` to allow for advanced extensions of signals (#53571) For the implementation of input signals, we want to extend the signal primitive. The basic methods exposed here are not suitable as we'd like to store additional metadata on the reactive node, and also have a custom getter (for required inputs and throwing). To enable this, one small piece was missing. This commit exposes it and also improves type safety, now that `SignalNode` is typed properly after the previous commit. PR Close #53571 04 January 2024, 20:07:12 UTC
69b384c fix(core): `SignalNode` reactive node incorrectly exposing unset field (#53571) The `SignalNode` interface, describing the reactive node for a `Signal`, seemingly exposes the `SIGNAL` symbol as a class member. This is not true as the `SIGNAL` reactive node only exists on the getter function, as a way to retrieve the signal underlying reactive node. This commit fixes this, enabling improved type-safety later, in a follow-up commit where `SIGNAL_NODE` can now be typed to match the `SignalNode` interface (unlike now where it's typed as just `object`). PR Close #53571 04 January 2024, 20:07:12 UTC
3eaa006 test(compiler-cli): additional type-check transform tests for signal inputs (#53571) This commit adds additional type-check transform tests for signal inputs. These tests verify some of the problems with covariance, contravariance and bivariance that we were suspecting to be problematic if we would assign `InputSignal`'s directly to the type constructors. PR Close #53571 04 January 2024, 20:07:12 UTC
1c63edd refactor(router): remouve unused (#53750) minor optimisation, removing unused paramters. PR Close #53750 03 January 2024, 21:29:05 UTC
58f2b74 refactor(core): Remove `LContainerFlags.HasChildViewsToRefresh` (#53715) This flag is not actually read anywhere. It doesn't even have any effect on the traversal algorithm because embedded views are always refreshed in `Global` traversal mode during the refresh of their parent views. PR Close #53715 03 January 2024, 21:01:35 UTC
c59a4dc refactor(core): Use NoopNgZone in componentFixture (#53670) The `ComponentFixture` code needlessly dances around the `ngZone` being `null` when the `ComponentFixtureNoNgZone` option is set. Instead, it can use the `NoopNgZone` to get the same effect without needing to have checks all over the place for its presence. PR Close #53670 03 January 2024, 19:28:08 UTC
ec661a3 refactor(compiler): Fix ambiguous repeater context variables in template pipeline (#53662) In #52931, Kristiyan fixed a TemplateDefinitionBuilder bug in which derived alias variables in for loops (`$even`, `$first`, etc) were referring to the wrong level of nested `@for` block. (These variables are unique because they become inlined expressions, and are not "real" context variables.) He fixed this by appending level information to the generated alias name. Template Pipeline actually suffered from the same bug. We fix it in a very similar way -- in particular, whenever these derived context variables are used, we make them depend on versions of `$index` and `$count` that have been suffixed with the xref of the enclosing repeater. I have added a few more pipeline goldens, because we are not quite as clever as TDB about only generating the duplicate suffixed index and count variables when inside nested loops. This is fine, since in the long run, we want to refactor it more fundamentally. I have also added a TODO to fix this more rigorously. In particular, it would be nice if we had proper support for shadowed variables, as well as unlimited levels of variables depending on one another. PR Close #53662 03 January 2024, 19:24:20 UTC
3584a23 test(compiler): Fix mangling of camel case CSS vars in host bindings (#53665) Template pipeline previously mangled CSS property names like `--camelCase` when used in host style bindings. Note: It still *does* mangle these names in static style attrs, both in host bindings and on elements. This is clearly wrong, but is consistent with what TDB does today. PR Close #53665 03 January 2024, 19:23:37 UTC
fed831f docs: fix incorrect glossary entry (#53609) PR Close #53609 03 January 2024, 18:34:54 UTC
1a6eaa0 fix(compiler-cli): input transform in local compilation mode (#53645) Currently compiling input transform in local mode breaks, since compiler does static analysis for the transform function, and this cannot be done in local mode if the function is imported from another compilation unit. In this fix the static analysis is ditched in local mode. PR Close #53645 03 January 2024, 18:29:34 UTC
dd052dc fix(common): server-side rendering error when using in-memory scrolling (#53683) Fixes that the `BrowserViewportScroller` was throwing an error during server-side rendering because it was accessing `window` directly. Also removes some assertions that aren't necessary anymore. Fixes #53682. PR Close #53683 03 January 2024, 18:28:55 UTC
4cb4e98 refactor(core): remove duplicate stringify (#53751) `throwProviderNotFoundError` already stringifies for error. Also let's restrain the paramter type. PR Close #53751 03 January 2024, 18:27:37 UTC
ce41575 refactor(core): minor improvements (#53751) minor optimisation, removing unused paramters and improve tree shaking PR Close #53751 03 January 2024, 18:27:37 UTC
33b5707 fix(compiler-cli): interpolatedSignalNotInvoked diagnostic (#53585) The diagnostic was catching the following case: ```ts name = signal('Angular'); ``` but not the following ones: ```ts name = signal('Angular').asReadonly(); name = computed(() => 'Angular'); name!: Signal<string> ``` This was not catched in the tests because the type of `Signal` is different than the one actually used in core. It turns out the real type forces the diagnostic to check both the `symbol.tsType.symbol` and the `symbol.tsType.aliasSymbol`. PR Close #53585 03 January 2024, 18:19:54 UTC
3302425 refactor(compiler): Fix handling of namespaced attributes (#53646) It's possible for attributes to have a namespace, we need to handle this possiblity for both attribute instructions and attributes extracted to the consts array. PR Close #53646 03 January 2024, 18:19:02 UTC
1731988 refactor(compiler): Add a test for attribute namespaces (#53646) We currently do not support the `namespace` argument for the attribute instruction. (Who knew it even existed!) PR Close #53646 03 January 2024, 18:19:02 UTC
163e7ad docs: remove duplicate words (#53673) PR Close #53673 03 January 2024, 18:17:55 UTC
2b9a850 fix(core): allow effect to be used inside an ErrorHandler (#53713) `effect` was expecting an `ErrorHandler` in its constructor which can lead to a circular DI error if an effect is used inside a custom `ErrorHandler`. These changes inject the `ErrorHandler` only when reporting errors. Fixes #52680. PR Close #53713 03 January 2024, 18:17:30 UTC
043b1ff refactor(common): Fix fake navigation to work with relative navigations (#53719) This commit updates the implementation of the fake navigation to support relative navigation requests. PR Close #53719 03 January 2024, 18:16:57 UTC
6586b99 refactor(router): use MockPlatformLocation for integration tests (#53640) Use of the `SpyLocation` is problematic because it prevents location APIs from reaching the platform level (`PlatformLocation`) and `PathLocationStrategy`. This makes it difficult to test interactions with those providers, including the ability to use the `Navigation` API, which will live at the platform level. PR Close #53640 03 January 2024, 18:15:54 UTC
e5f0205 fix(compiler): ignore empty switch blocks (#53776) Adds some code to the compiler so that it ignores empty `@switch` blocks instead of trying to generate code for them. Fixes #53773. PR Close #53776 03 January 2024, 18:15:17 UTC
d315e2c release: cut the v17.1.0-next.5 release 21 December 2023, 14:33:32 UTC
9e2e5d6 docs: release notes for the v17.0.8 release 21 December 2023, 14:29:29 UTC
c4de4e1 refactor(docs-infra): build adev application using local generated assets (#53511) Use local generated assets to build adev application. PR Close #53511 20 December 2023, 22:49:31 UTC
8d58595 refactor(core): Add scheduler abstraction and notify when necessary (#53499) In order to provide a reasonable experience for Angular without Zones, we need a mechanism to run change detection when we receive a change notification. There are several existing APIs today that serve as the change notification: `ChangeDetectorRef.markForCheck`, signal updates, event listeners (since they mark the view dirty), and attaching a view to either the `ApplicationRef` or `ChangeDetectorRef`. These operations are now paired with a notification to the change detection scheduler. The concrete implementation for this scheduler is still being designed. However, this gives us a starting point to partner with teams to experiment with what that might look like. PR Close #53499 20 December 2023, 15:53:31 UTC
cc74ebf refactor(compiler): Rework how ICU placeholders are handled (#53643) The way we were handling ICU placeholders was not compatible with using interpolations on attributes of elements inside the ICU. This change refactors the handling of ICU placeholders and unifies the way expression and tag placeholders work inside ICUs. The new approach modifies the ingest logic to add the placeholder on to the TextOp rather than the TextInterpolationOp. This is because, in ICUs, we may need multiple i18n expressions created from the interpolation expressions to roll up into the same placeholder. ICUs essentially do the interpolation at compile time, combining the static strings with special placeholder strings that represent the expression values. PR Close #53643 20 December 2023, 15:23:54 UTC
cafc3b0 refactor(compiler): Drop the explicit `this.` in most explicit receivers (#53594) Consider a case when an explicit `this` read is inside a template with a context that also provides the variable name being read: ``` <ng-template let-a>{{this.a}}</ng-template> ``` Clearly, `this.a` should refer to the class property `a`. However, in today's Angular, `this.a` will refer to `let-a` on the template context. Amazingly, both TemplateDefinitionBuilder and the Typecheck block have the same bug, and are consistent with each other! This is because `ImplicitReceiver` extends `ThisReceiver` in the parser AST, which is an insane gotcha. In this commit, I patch the template pipeline to emulate this behavior as well. To actually fix this nastiness, we have to: - Update `ingest.ts` in the Template Pipeline (see the corresponding comment) - Check `type_check_block.ts` in the Typecheck block code (see the corresponding comment) - Turn off legacy TemplateDefinitionBuilder - Fix g3, and release in a major version PR Close #53594 19 December 2023, 21:46:11 UTC
3212935 refactor(compiler): Tricky implicit context issue in template pipeline (#53594) Add a failing tests about an implicit context issue; I will debug this shortly. PR Close #53594 19 December 2023, 21:46:11 UTC
89dd890 refactor(compiler): Put projection instructions through the regular element const collection (#53594) `ng-content` elements, and thus their corresponding projection instructions, can have many attributes on them. Some of these attributes may result in special behavior. For example, `ngProjectAs` and `i18n-foo` both result in special const collection, into the approprate BindingKind slot in the const array. Additionally, `i18n-foo` needs to recieve all the additional i18n attribute processing. We solve this by subjecting `ng-content` attributes to all the same pipeline logic that applies to attributes on elements, and then allow the element const collection phase to collect them. PR Close #53594 19 December 2023, 21:46:11 UTC
9ecf0b3 refactor(compiler): Host bindings do not const collect listener names (#53594) For regular templates, any listener will have its name const collected into the bindings section of the element consts. In contrast, host bindings omit listener names from their hostAttrs. This is a strange and inconsistent behavior, so we hide it behind a compatiblity mode flag. PR Close #53594 19 December 2023, 21:46:11 UTC
0b11445 refactor(compiler): Host bindings have a different order for update instructions (#53594) Annoyingly, TDB uses a separate code path for host bindings, and they have a different order. PR Close #53594 19 December 2023, 21:46:11 UTC
be54cc8 refactor(compiler): Don't allow pipe bindings in track functions (#53594) For block track functions may not contain pipe bindings. PR Close #53594 19 December 2023, 21:46:11 UTC
3e71957 refactor(compiler): Fix a naming collision in template pipeline (#53594) We has some special behavior for naming identifiers in Template Pipline, for the sake of compatibility with TDB's source maps tests. However, this has the potential to cause a variable name collision in a particular special case (when the identifier is `ctx`). We add a special check for this, and also tuck all the backwards-compatible naming code inside a compatibility block. PR Close #53594 19 December 2023, 21:46:10 UTC
f89030b refactor(compiler): Add source maps support for i18n instructions (#53594) i18n start/end instructions now take the source spans of the elements they refer to. PR Close #53594 19 December 2023, 21:46:10 UTC
12181b9 refactor(core): Use single source of truth for `ApplicationRef.isStable` (#53576) This commit updates the `ApplicationRef.isStable` implementation to use a single `Observable` to manage the state. This simplifies the mental model quite a bit and removes the need for rx operators like `distinctUntilChanged` and `combineLatest`. PR Close #53576 19 December 2023, 20:42:45 UTC
d49333e fix(migrations): cf migration - detect and error when result is invalid i18n nesting (#53638) (#53639) This will gracefully error on templates when the resulting template would have invalid i18n nested structures. PR Close #53638 PR Close #53639 19 December 2023, 20:22:01 UTC
fb7c58c fix(migrations): cf migration - detect and error when result is invalid i18n nesting (#53638) This will gracefully error on templates when the resulting template would have invalid i18n nested structures. PR Close #53638 19 December 2023, 19:01:57 UTC
22b95de fix(migrations): cf migration - fix bug in attribute formatting (#53636) The formatting that would preserve attribute indents completely missed attributes that start on new lines rather than the same line as the opening element. PR Close #53636 19 December 2023, 18:16:29 UTC
back to top