28623 Commits

Author SHA1 Message Date
Pawel Kozlowski 5f6323c36d release: cut the v17.0.5 release 17.0.5 2023-11-29 18:18:16 +01:00
Jessica Janiuk 6ae408847c fix(migrations): properly handle ngIfThen cases in CF migration (#53256)
The migration was handling bound casees of [ngIfThenElse] and also needed [ngIfThen].

fixes: #53254

PR Close #53256
2023-11-29 17:34:02 +01:00
Jessica Janiuk c22af72f75 fix(migrations): fix off by one issue with template removal in CF migration (#53255)
When ng-templates are removed, an extra space was being added when it was unnecessary. This resulted in malformed html if there was no space afterwards.

fixes: #53248

PR Close #53255
2023-11-29 17:33:19 +01:00
Jessica Janiuk 5b9f896009 fix(migrations): cf migration fix migrating empty switch default (#53237)
This should address cases when using ng-containers with ngSwitchCase / ngSwitchDefault
and migrating them safely when they are empty.

fixes: #53235

PR Close #53237
2023-11-29 15:15:50 +01:00
Miles Malerba baf5830bc9 test(compiler): Update golden partial file (#53209)
Updates the golden partial file to account for the newly added test

PR Close #53209
2023-11-29 10:31:51 +01:00
Miles Malerba a31f65d86c refactor(compiler): Fix order of compound template/element param values (#53209)
As part of this fix, I realized that child i18n blocks don't need their
own context. Instead, we can just add their params directly to the
context for their root block, and forgo the step of merging the contexts.

PR Close #53209
2023-11-29 10:31:50 +01:00
Miles Malerba 44108f2f87 refactor(compiler): Fix sub-template index logic (#53209)
Fixes a bug in the sub-template index logic that caused it to reuse
indices that had already been assigned to more deeply nested templates

PR Close #53209
2023-11-29 10:31:50 +01:00
Miles Malerba efca206ed8 refactor(compiler): Fix i18n parms for structural directives (#53209)
Structural directives inside an i18n block previously resulted in a
"list" param value (represented as "[...|...]"). This commit adds a
special case to the template pipeline to collapse the list into a single
compound value like TemplateDefinitionBuilder does.

PR Close #53209
2023-11-29 10:31:50 +01:00
Miles Malerba 787367831e refactor(compiler): Record sub-messages as belonging to root i18n block (#53209)
ICU sub-messages should be recorded as belonging to the message for the
root i18n block they are part of. This ensures that they still get
emitted even if they are nested in a child template.

PR Close #53209
2023-11-29 10:31:50 +01:00
Miles Malerba d121e4e91f refactor(compiler): Add contextType to I18nContextOp (#53209)
Adding a context type makes code that depends on the kind of context
more explicit and easier to follow

PR Close #53209
2023-11-29 10:31:50 +01:00
Jessica Janiuk 2b3d3b0fe1 fix(migrations): CF migration log warning when collection aliasing detected in @for (#53238)
This logs a warning when an ngFor has a collection aliased, which is not supported with new syntax.

fixes: #53233

PR Close #53238
2023-11-29 10:29:53 +01:00
Andrew Kushnir 6be88040d1 fix(core): avoid stale provider info when TestBed.overrideProvider is used (#52918)
This commit updates the logic to preserve previous value of cached TView before applying overrides. This helps ensure that the next tests that uses the same component has correct provider info.

PR Close #52918
2023-11-29 09:48:53 +01:00
Jessica Janiuk dffeac8386 fix(migrations): cf migration removes unnecessary bound ngifelse attribute (#53236)
this removes a no longer necessary attribute in bound ngIfElse cases.

fixes: #53230

PR Close #53236
2023-11-29 09:47:45 +01:00
aparziale b2e3b3e22e docs: suggestions applied (#53117)
PR Close #53117
2023-11-28 19:43:31 +01:00
aparzi 6f3b7a73b2 docs: updates the documentation for the ToH tutorial more comprehensively (#53117)
PR Close #53117
2023-11-28 19:43:30 +01:00
Alan Agius df01a5cb23 test: refactor platform-server integration tests to use application builder (#53219)
This commit updates the platform-server tests to use the new application builder, with this change we also have to remove the sizechecks since esbuild will do code motion and split the code into multiple chunks example `chunk-QUKLKPSE.js`.

PR Close #53219
2023-11-28 19:29:09 +01:00
Jessica Janiuk ba6d7fe018 fix(migrations): fixes CF migration i18n ng-template offsets (#53212)
This addresses an issue where multiple ng-templates are present with i18n attributes. The offsets would be incorrectly accounted for when being replaced with an ng-container.

fixes: #53149

PR Close #53212
2023-11-28 16:44:11 +01:00
Jessica Janiuk 0fcef65cea fix(migrations): Update CF migration to skip templates with duplicate ng-template names (#53204)
This adds a message to the console and skips any templates that detect duplicate ng-template names in the same component.
fixes: #53169

PR Close #53204
2023-11-28 16:43:28 +01:00
Jessica Janiuk dbd6f386ea fix(migrations): allows colons in ngIf else cases to migrate (#53076)
This makes sure colons after else and then cases get migrated properly.
fixes: #53150

PR Close #53076
2023-11-28 14:03:29 +01:00
Jessica Janiuk 8f6affdd64 fix(migrations): fixes control flow migration common module removal (#53076)
Common module removal would not happen when a component used a templateUrl due to the checks being in separate files. This change passes the removal analysis back to the original source file to safely remove CommonModule.

PR Close #53076
2023-11-28 14:03:29 +01:00
Jessica Janiuk aab7fb8654 fix(migrations): Add ngForTemplate support to control flow migration (#53076)
This adds code to cover the rare use case of an ngFor with a template param.
fixes: #53068

PR Close #53076
2023-11-28 14:03:29 +01:00
Jessica Janiuk 00cb3339ba fix(migrations): control flow migration formatting fixes (#53076)
This fix preserves leading indents in inline templates and also adds better handling for self closing tags

PR Close #53076
2023-11-28 14:03:29 +01:00
Angular Robot 92a28a77b1 build: update dependency jsdom to v23 (#53194)
See associated pull request for more information.

PR Close #53194
2023-11-28 11:04:52 +01:00
y cf3de8351f docs: fix recurring typo in adev (#53172)
PR Close #53172
2023-11-28 10:59:53 +01:00
y 836c1e1bb2 docs: fix typo in hello-world tutorial (#53172)
PR Close #53172
2023-11-28 10:59:53 +01:00
Angular Robot 955e978978 build: update dependency angular-split to v17 (#53100)
See associated pull request for more information.

PR Close #53100
2023-11-28 10:57:28 +01:00
Nikolay Ponich 115dc23317 build: upgrade node version for .devcontainer example file (#53157)
PR Close #53157
2023-11-27 15:49:35 +01:00
Kristiyan Kostadinov 4604be2502 refactor(platform-browser): clean up legacy way of getting a relative path (#53097)
Currently the way we extract the pathname of a URL is by creating an anchor node, assigning the URL to its `href` and reading the `pathname`. This is inefficient and it triggers an internal security check that doesn't allow the `href` attribute to be set which ends up blocking https://github.com/angular/components/pull/28155.

These changes switch to using the browser's built-in URL parsing instead.

PR Close #53097
2023-11-27 10:59:53 +01:00
Angular Robot 6d61f2df3a build: update dependency karma-jasmine-html-reporter to v2 (#52544)
See associated pull request for more information.

PR Close #52544
2023-11-27 10:47:54 +01:00
Timon fbc8c567a2 docs: typo in prerendering.md (#52868)
PR Close #52868
2023-11-27 10:46:58 +01:00
Angular Robot 935fa8fbe0 build: update dependency globby to v14 (#52804)
See associated pull request for more information.

PR Close #52804
2023-11-21 10:31:36 -08:00
Angular Robot 7d88c5f6eb build: update dependency karma-jasmine to v5 (#52543)
See associated pull request for more information.

PR Close #52543
2023-11-21 10:30:25 -08:00
Sasidharan SD 53bd876266 docs: fix bold text in lifecycle markdown (#53079)
PR Close #53079
2023-11-21 10:29:37 -08:00
Doug Parker a26f281b52 docs: provide clearer instructions for migrating existing SSR apps to application builder (#52762)
This ports https://github.com/angular/angular/pull/52485 to angular.dev.

PR Close #52762
2023-11-21 10:28:53 -08:00
Kristiyan Kostadinov dee50f1d78 fix(core): inherit host directives (#52992)
Adds support for inheriting host directives from the parent class. This is consistent with how we inherit other features like host bindings.

Fixes #51203.

PR Close #52992
2023-11-20 13:16:16 -08:00
Leonel Franchelli 91486aaf07 fix(router): Resolvers in different parts of the route tree should be able to execute together (#52934)
The following commit accidentally broken execution of resolvers when
two resolvers appear in different parts of the tree and do not share a
https://github.com/angular/angular/commit/327896606832bf6fbfc8f23989755123028136a8

This happens when there are secondary routes. This test ensures that all
routes with resolves are run.

fixes #52892

PR Close #52934
2023-11-20 12:07:11 -08:00
Andrew Scott 07920d96d4 fix(core): Reattached views that are dirty from a signal update should refresh (#53001)
Related to #52928 but `updateAncestorTraversalFlagsOnAttach` is called
on view insertion and _should_ have made that work for views dirty from
signals but it wasn't updated to read the `dirty` flag when we changed
it from sharing the `RefreshView` flag.

For #52928, we've traditionally worked under the assumption that this is working
as expected.  The created view is `CheckAlways`. There is a question of whether we
should automatically mark things for check when the attached view has
the `Dirty` flag and/or has the `FirstLViewPass` flag set (or other
flags that indicate it definitely needs to be prefreshed).

PR Close #53001
2023-11-20 12:06:33 -08:00
Matthieu Riegler 42272a0db6 refactor(core): replace runInContext by runInInjectionContext (#53035)
Saves a few bytes since function names can be mangled.

PR Close #53035
2023-11-20 12:05:01 -08:00
yuki b65dd2327e docs: fix packages\core\src\application_init.ts (#53040)
PR Close #53040
2023-11-20 12:04:17 -08:00
Andrew Kushnir 710a24a7d0 release: cut the v17.0.4 release 17.0.4 2023-11-20 11:43:40 -08:00
Jessica Janiuk 0fad36eff2 fix(migrations): tweaks to formatting in control flow migration (#53058)
This addresses a few minor formatting issues with the control flow migration.

fixes: #53017

PR Close #53058
2023-11-20 10:46:43 -08:00
Kristiyan Kostadinov 291deac663 fix(compiler): generate i18n instructions for blocks (#52958)
Adds support for generating i18n instructions inside of blocks.

Fixes #52540.
Fixes #52767.

PR Close #52958
2023-11-20 08:59:26 -08:00
Kristiyan Kostadinov f01b7183d2 fix(compiler): produce placeholder for blocks in i18n bundles (#52958)
When blocks were initially implemented, they were represented as containers in the i18n AST. This is problematic, because block affect the structure of the message.

These changes introduce a new `BlockPlaceholder` AST node and integrate it into the i18n pipeline. With the new node blocks are represented with the `START_BLOCK_<name>` and `CLOSE_BLOCK_<name>` placeholders.

PR Close #52958
2023-11-20 08:59:25 -08:00
anthonyfr75 ac9cd6108f fix(migrations): control flow migration fails for async pipe with unboxing of observable (#52756) (#52972)
Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes #52756

PR Close #52972
2023-11-20 08:58:45 -08:00
arturovt 7f1c55755d fix(common): remove load on image once it fails to load (#52990)
This commit adds an `error` listener to image elements and removes both
`load` and `error` listeners once the image loads or fails to load. The `load`
listener would never have been removed if the image failed to load.

PR Close #52990
2023-11-20 08:58:07 -08:00
arturovt fafcb0d23f fix(common): scan images once page is loaded (#52991)
This commit updates the implementation of the `ImagePerformanceWarning` and
runs the image scan even if the page has already been loaded. The `window.load`
event would never fire if the page has already been loaded; that's why we're
checking for the document's ready state.

PR Close #52991
2023-11-20 08:57:31 -08:00
Jessica Janiuk 492ad4698a fix(migrations): fixes migrations of nested switches in control flow (#53010)
This separates out the NgSwitch migration pass from the NgSwitchCase / Default pass, which makes nested switch migrations work.

fixes: #53009

PR Close #53010
2023-11-20 08:56:53 -08:00
Jessica Janiuk 13bf5b7007 fix(migrations): Fixes control flow migration if then else case (#53006)
With if then else use cases, we now properly account for the length
of the original element's contents when tracking new offsets.

fixes: #52927

PR Close #53006
2023-11-20 08:56:18 -08:00
Nicolas Frizzarin ef974647b0 docs: example code afterNextRender phase (#53025)
Currently in the angular.dev documentation, afterNextRender function
take directly the phase as a second parameter which is not correct.
According to the api of this hook, the second parameter is an object
which contains the phase. This PR update the part of the documentation

PR Close #53025
2023-11-20 08:55:38 -08:00
arturovt db1a8ebdb4 fix(core): cleanup loading promise when no dependencies are defined (#53031)
This commit cleans up the `loadingPromise` when no `dependenciesFn` is defined,
as it's already cleaned up after the resolution of `Promise.allSettled`. This
occurs with `prefetch on` triggers, such as when `triggerResourceLoading` is called
from `ɵɵdeferPrefetchOnImmediate`, where there are no dependencies to load. The
`loadingPromise` should still be cleaned up because it typically involves the
`ZoneAwarePromise`, which isn't properly garbage collected when referenced elsewhere
(in this case, it would be referenced from the `tView` data).

PR Close #53031
2023-11-20 08:54:41 -08:00