28897 Commits

Author SHA1 Message Date
Dylan Hunn 3c3a947778 Revert "refactor(core): improve forwardRef typings"
This reverts commit 605eb83032.
2024-01-17 14:07:29 -08:00
Matthieu Riegler 8ef626e6b1 refactor(router): Use Nullish coalescing assignment when possible. (#53930)
Inspired by #53923, lets simplify code when possible.

PR Close #53930
2024-01-17 11:36:12 -08:00
Joey Perrott 4373889334 ci: use ng-dev-previews project for previews (#53958)
Rather than use the actual adev site, we should be using the ng-dev-preview site

PR Close #53958
2024-01-17 11:19:28 -08:00
Joey Perrott 3363295872 refactor: migrate modules to prettier formatting (#53954)
Migrate formatting to prettier for modules directory from clang-format

PR Close #53954
2024-01-17 09:42:00 -08:00
Matthieu Riegler 23f19f8705 docs: add platform-browser/animations/async entry to AIO (#53914)
fixes #53912

PR Close #53914
2024-01-17 09:14:43 -08:00
Joey Perrott ff989af39b ci: use the config from adev for adev previews (#53955)
Properly use the adev firebase config.

PR Close #53955
2024-01-17 09:13:42 -08:00
Andrew Kushnir eb6389e39b refactor(compiler): enable register and resolve phases for local compilation (#53901)
This commit update the logic to enable `register` and `resolve` phases for local compilation. Those phases will be useful for local compilation in certain cases (will be used in followup PRs).

PR Close #53901
2024-01-17 09:03:56 -08:00
Joey Perrott b607757214 ci: set up previews of adev (#53941)
Set up preview actions to allow for a preview of the adev site to be deployed for a PR with the `adev: preview` label.

PR Close #53941
2024-01-16 19:18:31 -08:00
Joey Perrott 170907684b ci: run adev tests on CI (#53941)
Run tests in adev for CI

PR Close #53941
2024-01-16 19:18:31 -08:00
Joey Perrott 92b1667890 refactor: migrate tools to prettier formatting (#53947)
Migrate formatting to prettier for tools directory from clang-format

PR Close #53947
2024-01-16 19:17:49 -08:00
AleksanderBodurri 80b77d98f9 docs(devtools): update development docs (#53948)
These docs are out of date with how we currently build devtools in dev mode and as a browser extension. This commit brings these docs up to date.

PR Close #53948
2024-01-16 19:17:19 -08:00
AleksanderBodurri 9019d03bd0 docs(devtools): remove devtools/CONTRIBUTING.md (#53948)
This is an artifact left over form the repo merge. There is already an existing CONTRIBUTING.md for this repo

PR Close #53948
2024-01-16 19:17:19 -08:00
Pawel Kozlowski 14bbd88650 refactor(core): re-organize queries code (#53922)
This commit splits the query implementation and instructions
into a separate files. This is a pattern frequently used by
other functional areas of the framework and is a preparation for
introducing queries-as-signals where we are going to see more
instructions delegating to the same core functionality.

PR Close #53922
2024-01-16 16:00:35 -08:00
Ilija Leko f843b78f2d docs: fix-build-path-in-http-server-command (#53226)
PR Close #53226
2024-01-16 09:37:11 -08:00
Joey Perrott 2d61080f3f build(docs-infra): enable prerendering for adev (#53871)
Enable the prerender option for adev's angular.json file.

PR Close #53871
2024-01-16 09:35:45 -08:00
Sasidharan SD 2d76a0df89 docs: remove repeated sentence (#53853)
PR Close #53853
2024-01-12 10:26:33 -08:00
Pawel Kozlowski 4c9d6b4940 refactor(core): improve forwardRef typings (#53880)
This commit improves the forwardRef typings for better
type safety and inference.

PR Close #53880
2024-01-12 10:26:02 -08:00
Andrew Scott 198e64ab75 fix(core): TestBed should still use the microtask queue to schedule effects (#53843)
Prior to this commit, `TestBed` would require tests call `flushEffects`
or `fixture.detectChanges` in order to execute effects. In general, we
want to discourage authoring tests like this because it makes the timing
of change detection and effects differ from what happens in the
application. Instead, developers should perform actions and `await` (or
`flush`/`tick` when using `fakeAsync`) some `Promise` so that Angular
can react to the changes in the same way that it does in the
application.

Note that this still _allows_ developers to flush effects synchronously
with `flushEffects` and `detectChanges` but also enables the <action>,
`await` pattern described above.

PR Close #53843
2024-01-11 12:05:57 -08:00
Joey Perrott 425a8d3359 build: set up adev testing (#53854)
Set up testing for the adev directory

PR Close #53854
2024-01-10 15:22:36 -08:00
Andrew Scott 37e27694ff release: cut the v17.0.9 release 17.0.9 2024-01-10 14:08:44 -08:00
David LJ 74094e1158 docs: fix & update apf links to pkg examples (#53866)
PR Close #53866
2024-01-10 10:43:55 -08:00
Andrew Scott b7cddf4e1e 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
2024-01-09 16:05:32 -08:00
Andrew Scott 62498f5e3a 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
2024-01-09 16:05:32 -08:00
Jan Kuehle f4b1e6482c 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
2024-01-09 13:20:51 -08:00
Jan Kuehle b3aec87f57 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
2024-01-09 13:20:51 -08:00
Kristiyan Kostadinov 92fd6cc42e 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
2024-01-09 12:27:58 -08:00
Tomasz Ducin c4b266cace 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
2024-01-09 12:17:48 -08:00
Joey Perrott 3ae74e431e ci: add adev to ci (#53833)
Add adev job to CI to ensure it continues to build as expected

PR Close #53833
2024-01-09 12:16:03 -08:00
Nadeem Ur-Rehman 4a64d2034b docs(docs-infra): wrong URL for Unicode CLDR fixed (#53785)
fixes wrong URLs for Unicodde CLDR

Fixes #53734

PR Close #53785
2024-01-09 12:13:15 -08:00
Jessica Janiuk e92c86b77f 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
2024-01-09 12:09:41 -08:00
Andrew Scott 9c58717767 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
2024-01-09 08:51:33 -08:00
Joey Perrott c22b513b3f 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
2024-01-08 14:38:51 -08:00
Joey Perrott 8e49e38f44 fix(docs-infra): include the homepage playground content (#53832)
Include the homepage playground content in the homepage

PR Close #53832
2024-01-08 11:33:18 -08:00
Joey Perrott 3e00a7fdc6 build: update cross-repo angular dependencies (#53837)
See associated pull request for more information.

PR Close #53837
2024-01-08 11:31:17 -08:00
Andrew Scott 441db5123f 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
2024-01-08 11:30:28 -08:00
Jeremy Elbourn 15a973f151 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
2024-01-05 11:27:34 -08:00
Matthieu Riegler 8fa5ebba7d 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
2024-01-04 13:58:17 -08:00
Matthieu Riegler d68efac4fd refactor(router): replace Object.keys with Object.entries where useful. (#53745)
`Object.entries` wasn't supported when those lines were written.

PR Close #53745
2024-01-04 13:57:22 -08:00
mgechev f8dcd1824a docs: remove state of js 2023 banner (#53798)
PR Close #53798
2024-01-04 13:56:21 -08:00
Andrew Scott 91cb16fde9 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
2024-01-04 12:51:22 -08:00
Matthieu Riegler 5f73737981 refactor(router): remouve unused (#53750)
minor optimisation, removing unused paramters.

PR Close #53750
2024-01-03 13:29:06 -08:00
Andrew Scott 5fb199bfc6 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
2024-01-03 13:01:35 -08:00
Andrew Scott 7bf11eaf41 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
2024-01-03 11:28:13 -08:00
Dylan Hunn 5f4f0a9bdd 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
2024-01-03 11:24:20 -08:00
Miles Malerba 50788f6b74 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
2024-01-03 11:23:38 -08:00
Johnny Gérard 7c19dc21a2 docs: fix incorrect glossary entry (#53609)
PR Close #53609
2024-01-03 10:34:55 -08:00
Kristiyan Kostadinov bd9f89d1c8 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
2024-01-03 10:28:55 -08:00
Matthieu Riegler fad9e952ae refactor(core): remove duplicate stringify (#53751)
`throwProviderNotFoundError` already stringifies for error. Also let's restrain the paramter type.

PR Close #53751
2024-01-03 10:27:37 -08:00
Matthieu Riegler fdb05d92c5 refactor(core): minor improvements (#53751)
minor optimisation, removing unused paramters and improve tree shaking

PR Close #53751
2024-01-03 10:27:37 -08:00
cexbrayat 7309463697 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
2024-01-03 10:19:54 -08:00