Commit graph

28639 commits

Author SHA1 Message Date
Jessica Janiuk
6291c8db09 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:18 +01:00
Jessica Janiuk
fadfee4324 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
c9f8e75b6f 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:50 +01:00
Miles Malerba
4c5f3b52dc 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
2eadc955a3 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
898033f868 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
1881fb881a 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
e1640f92ac 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
b2aeaf5d97 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:52 +01:00
Andrew Kushnir
58cf389d80 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
c6326289f8 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:44 +01:00
aparziale
e3dbadd9a4 docs: suggestions applied (#53117)
PR Close #53117
2023-11-28 19:43:30 +01:00
aparzi
ae0fdf1eed docs: updates the documentation for the ToH tutorial more comprehensively (#53117)
PR Close #53117
2023-11-28 19:43:30 +01:00
Jessica Janiuk
f1b7d40057 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
8a52674faa 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
53912fdf74 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:28 +01:00
Jessica Janiuk
a738b48717 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:28 +01:00
Jessica Janiuk
dbca1c9d61 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:28 +01:00
Jessica Janiuk
e6f10e81d2 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:28 +01:00
Kristiyan Kostadinov
4c1d69e288 fix(compiler-cli): add diagnostic for control flow that prevents content projection (#53190)
This is a follow-up to the fix from #52414. It adds a diagnostic that will tell users when a control flow is preventing its direct descendants from being projected into a specific component slot.

PR Close #53190
2023-11-28 11:18:43 +01:00
Kristiyan Kostadinov
8d43dbc7f3 test(core): add tests for control flow content projection with ng-container (#53190)
The control flow projection diagnostic will mention `ng-container` as a workaround for projection multiple nodes. These changes add a couple of tests to ensure that the approach works.

PR Close #53190
2023-11-28 11:18:43 +01:00
Kristiyan Kostadinov
897391ccbd refactor(compiler-cli): expose ng-content selectors and preserveWhitespaces during template type checking (#53190)
These changes expose the `ngContentSelectors` and `preserveWhitespaces` metadata to the TCB so they can be used in the next commit to implement a new diagnostic.

PR Close #53190
2023-11-28 11:18:43 +01:00
Kristiyan Kostadinov
11207deb5a refactor(compiler): expose utility for creating CSS selectors from AST nodes (#53190)
When doing directive matching in the compiler, we need to be able to create a selector from an AST node. We already have the utility, but these changes simplify the public API and expose it so it can be used in `compiler-cli`.

PR Close #53190
2023-11-28 11:18:43 +01:00
Alan Agius
e8ad51aaed test: refactor platform-server integration tests to use application builder (#53205)
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 #53205
2023-11-28 11:07:01 +01:00
Angular Robot
8c9c14582e 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
186190990d docs: fix recurring typo in adev (#53172)
PR Close #53172
2023-11-28 10:59:52 +01:00
y
078acbcf71 docs: fix typo in hello-world tutorial (#53172)
PR Close #53172
2023-11-28 10:59:52 +01:00
Angular Robot
b3ecb63f4f build: update dependency angular-split to v17 (#53100)
See associated pull request for more information.

PR Close #53100
2023-11-28 10:57:27 +01:00
Nikolay Ponich
b76b3c619b build: upgrade node version for .devcontainer example file (#53157)
PR Close #53157
2023-11-27 15:49:35 +01:00
Charles Lyding
79ff91a813 fix(compiler): allow TS jsDocParsingMode host option to be programmatically set (#53126)
When the AOT compiler creates a delegated host for a provided TypeScript CompilerHost,
it delegates functionality back to the original via a series of internal method delegations.
However, unlike other members of the CompilerHost, `jsDocParsingMode` is not a method
and cannot be delegated in this way. Attempting to call bind on the property will result
in a runtime error. Instead, `jsDocParsingMode` is now delegated via get/set accessors.
Additionally, the override of `getSourceFile` now has an updated type signature to reflect
the additional of the `jsDocParsingMode` option for the method.

PR Close #53126
2023-11-27 12:02:11 +01:00
Kristiyan Kostadinov
162d940b72 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
6e1bf29da2 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
0e722e9ede docs: typo in prerendering.md (#52868)
PR Close #52868
2023-11-27 10:46:58 +01:00
Kristiyan Kostadinov
c62b2dae8c build: update to TypeScript 5.3 final (#53087)
Bumps the repo to the final version of TypeScript 5.3.

PR Close #53087
2023-11-21 10:45:00 -08:00
Angular Robot
cb2db54b13 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
c652f7464e build: update dependency karma-jasmine to v5 (#52543)
See associated pull request for more information.

PR Close #52543
2023-11-21 10:30:24 -08:00
Sasidharan SD
b55638980f docs: fix bold text in lifecycle markdown (#53079)
PR Close #53079
2023-11-21 10:29:36 -08:00
Doug Parker
759421aae4 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:52 -08:00
Kristiyan Kostadinov
c7c7ea9813 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:15 -08:00
Leonel Franchelli
29e0834c4d 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
3278966068

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:10 -08:00
Andrew Scott
b35c6731e5 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:32 -08:00
Matthieu Riegler
e00ae2d07a 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:00 -08:00
yuki
d9a1528265 docs: fix packages\core\src\application_init.ts (#53040)
PR Close #53040
2023-11-20 12:04:17 -08:00
Andrew Kushnir
33959f4bea release: cut the v17.1.0-next.1 release 2023-11-20 11:56:49 -08:00
Andrew Kushnir
2ecda9fc4b docs: release notes for the v17.0.4 release 2023-11-20 11:47:00 -08:00
Jessica Janiuk
e090b48bf8 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
406049b95e 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:25 -08:00
Kristiyan Kostadinov
5fb707f81a 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:24 -08:00
anthonyfr75
e33f6e0f1a 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:44 -08:00
arturovt
29c5416d14 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:06 -08:00