31690 Commits

Author SHA1 Message Date
Matthieu Riegler a34090bc71 refactor(compiler): dynamic default for the partial compiler. (#58169)
Use `semver` in the partial compiler to decide on a default value

Co-authored-by: Alex Rickabaugh <alxhub@users.noreply.github.com>

PR Close #58169
2024-10-15 16:05:14 +00:00
Matthieu Riegler 6b8c494d05 feat(core): flipping the default value for standalone to true (#58169)
With this commit directives, components & pipes are standalone by default.

To be declared in an `NgModule`, those require now `standalone: false`.

PR Close #58169
2024-10-15 16:05:14 +00:00
Paul Gschwendtner bf9fd31e2e refactor(migrations): wire up best effort and insert TODO flag for queries migration (#58190)
Wires up the new migration flags for the `ng generate` queries migration
entry-point.

PR Close #58190
2024-10-15 13:49:22 +00:00
Paul Gschwendtner 1210c3699d refactor(migrations): add statistics to query migration (#58190)
Adds statistics to the query migration.

PR Close #58190
2024-10-15 13:49:22 +00:00
Paul Gschwendtner 0399ffcf44 refactor(migrations): remove outdated TODOs in queries migration (#58190)
These TODOs are no longer relevant.

PR Close #58190
2024-10-15 13:49:22 +00:00
Paul Gschwendtner 280e240f5f refactor(migrations): improve safety of queries migration when dealing with union types (#58190)
When dealing with union types of queries, we should be conservative in
the default mode and skip migration. That is because `viewChild()`
always includes `undefined`, but we cannot trivially emulate the
behavior where it was initially set to `null` (as an alternative to
`undefined`). Those queries can still be migrated via best effort
mode.

PR Close #58190
2024-10-15 13:49:21 +00:00
Paul Gschwendtner a748cb06f5 refactor(migrations): move queries problematic pattern check to analyze stage (#58190)
This will improve cross-target problematic pattern detection, with
batch execution.

Notably, unfortunately, the inheritance checking is still suboptimal for
the queries migration, simply because we don't know what fields are
queries during analyze stage. Theoretically we could track all edges of
classes/fields and filter out irrelevant edges during merge phase, but
this seems out of scope for now.

Signal inputs has the fully working checks. Only issue I can see is that
we don't properly propagate incompatibilities from derived to base
classes. This hasn't come up much though, so may be a follow-up based on
need.

PR Close #58190
2024-10-15 13:49:21 +00:00
Matthieu Riegler 97c44a1d6c feat(core): Promote takeUntilDestroyed to stable. (#58200)
`takeUntilDestroyed` is now part of the public API.

PR Close #58200
2024-10-15 12:52:26 +00:00
Paul Gschwendtner b4de7acbf5 refactor(migrations): improve heuristic of untyped .componentInstance in signal migrations (#58191)
We currently extend `.componentInstance` accesses (which are `any` for
`DebugElement`). We are doing this for `By.directive(T)` invocations,
but can expand this for other common expressions like with harnesses.

E.g.

`harness.query(T).componentInstance`.

PR Close #58191
2024-10-15 12:08:53 +00:00
Daniel Sogl 6782acb007 docs: fix changelog typo (#58188)
PR Close #58188
2024-10-15 07:21:50 +00:00
Angular Robot 711e82e48f build: update scorecard action dependencies (#58202)
See associated pull request for more information.

PR Close #58202
2024-10-15 06:38:06 +00:00
Jessica Janiuk 9224f9b043 refactor(core): Add mouseover to hover dom triggers (#58197)
Unfortunately mouseenter is a synthetic event, meaning it does not bubble in the same ways. So mouseover needs to be included in this list in order to get proper browser replayability of the mouse hovering events.

PR Close #58197
2024-10-14 14:27:04 -07:00
Jessica Janiuk d8b5f4e0c2 refactor(core): restructure hydration test files (#58196)
This re-organizes the hydration tests to make it easier to add new tests. Incremental hydration can have tests in a separate file after this groundwork is landed.

PR Close #58196
2024-10-14 14:26:26 -07:00
Jessica Janiuk d6a8d35aec refactor(core): Update defer scheduler to use injector (#58195)
This updates the functions for defer scheduler triggers to use a passed in injector instead of an lview.

PR Close #58195
2024-10-14 14:25:51 -07:00
Matthieu Riegler 517da9532c refactor(core): Setup constant for standalone default value (#58175)
This commit is part of the migration to standalone by default and sets up 2 files with a default value for standalone. They are still `false` in this case to land the change into G3 first. The switch to `true` will be executed in a follow-up PR.

PR Close #58175
2024-10-14 16:01:41 +00:00
Charles Lyding bbca205d5e refactor(compiler): adjust HMR initializer block for improved Vite support (#58173)
For the HMR initializer block to support being used in a Vite setup with
import analysis, the import call expression needs to be a runtime generated
value and include the `@vite-ignore` special comment. Without the first,
Vite will error prior to loading the application. Without the second, a
warning will be shown for each import which is effectively each component
within the application when HMR is enabled.

PR Close #58173
2024-10-14 15:21:40 +00:00
Charles Lyding 4a6c6505d9 refactor(compiler): support generating URL expressions with dynamic imports (#58173)
The compiler's AST factories now support generating a dynamic import call
expression with either a string literal or an expression. The later is useful
for cases where the URL is dynamically created at runtime. Also, a leading
comment can now be added to the URL for cases where bundler behavior
needs to be included via special comments.

PR Close #58173
2024-10-14 15:21:40 +00:00
Matthieu Riegler c42759b7a0 refactor(compiler-cli): Update compliance golden partials (#58160)
This commit is part of the update to standalone by default

PR Close #58160
2024-10-14 14:58:58 +00:00
Matthieu Riegler c7fac7eecb refactor(language-service): Migrate manually ngtsc tests to standalone by default (#58160)
This commit is part of the migration to standalone by default.

PR Close #58160
2024-10-14 14:58:58 +00:00
Matthieu Riegler 7aa3097ab6 refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160)
This commit is part of the migration to standalone by default.

PR Close #58160
2024-10-14 14:58:58 +00:00
Matthieu Riegler afcc3ee209 refactor(core): Migrate modules directory with the schematic. (#58160)
All components, directives and pipes will now use standalone as default. Non-standalone decorators have now .

PR Close #58160
2024-10-14 14:58:58 +00:00
Matthieu Riegler e85021a7ba build: Migrate all integration tests with the schematic. (#58160)
All components, directives and pipes will now use standalone as default. Non-standalone decorators have now .

PR Close #58160
2024-10-14 14:58:58 +00:00
Matthieu Riegler 30766d6b77 refactor(devtools): Migrate with the schematic. (#58160)
All components, directives and pipes will now use standalone as default. Non-standalone decorators have now .

PR Close #58160
2024-10-14 14:58:57 +00:00
Matthieu Riegler 7cd0e8d575 refactor(docs-infra): Migrate with schematic. (#58160)
All components, directives and pipes will now use standalone as default. Non-standalone decorators have now .

PR Close #58160
2024-10-14 14:58:57 +00:00
Matthieu Riegler 09df589e31 refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160)
All components, directives and pipes will now use standalone as default.
Non-standalone decorators have now `standalone: false`.

PR Close #58160
2024-10-14 14:58:57 +00:00
Daniel Kimmich 9373c983fe docs: remove word repetition (#58187)
PR Close #58187
2024-10-14 13:19:41 +00:00
Doug Parker ba4340875a fix(compiler): ignore placeholder-only i18n messages (#58154)
Message which only contain a single placeholder cannot be translated, there is no static text to be translated. Therefore these messages can be skipped and shouldn't be extracted at all.

Ideally, Angular would throw an error if a message is only a placeholder, since it should not contain an `i18n` attribute at all. However this would be a breaking change and require a migration which isn't in scope right now. We can explore converting this to a hard error sometime in the future.

PR Close #58154
2024-10-13 16:48:34 +00:00
Paul Gschwendtner 37e3b03b52 refactor(migrations): improve readability of strictness logic in input migration (#58168)
This commit improves readability/reasoning of the input converting logic
that does things differently based on strictness flags.

PR Close #58168
2024-10-13 16:47:03 +00:00
Paul Gschwendtner 7e785588a7 refactor(migrations): gracefully proceed migration if there is an invalid query (#58168)
In rare cases, there may be queries that fail Angular compiler-cli
extraction. This should not prevent migration of other queries and
instead be a graceful error.

PR Close #58168
2024-10-13 16:47:03 +00:00
Paul Gschwendtner 2cf88bba9a refactor(language-service): add support for running best-effort queries refactoring (#58168)
This is a follow-up to the VSCode queries code refactoring feature. This
commit adds support for running the refactoring with
`--best-effort-mode`.

PR Close #58168
2024-10-13 16:47:03 +00:00
Paul Gschwendtner 10d294c9d9 refactor(migrations): do not migrate .toArray, .first if query is skipped (#58168)
If a query is skipped for incompatibility reasons, we should not migrate
their `toArray`, `.first` references

PR Close #58168
2024-10-13 16:47:03 +00:00
Paul Gschwendtner f48354af0b refactor(migrations): support inserting TODOs for queries migration (#58168)
Allows users to enable TODO insertion to see why certain queries did not
get migrated.

PR Close #58168
2024-10-13 16:47:03 +00:00
Paul Gschwendtner 4b089621be refactor(migrations): share TODO insertion logic of input migration (#58168)
This allows us to re-use the same logic in the queries migration.

PR Close #58168
2024-10-13 16:47:03 +00:00
Paul Gschwendtner a141ee8fb2 refactor(migrations): add best-effort-mode for queries migration (#58168)
Allows users to ignore detected incompatibilities and migrate as much as
possible. Similar to the input migration.

PR Close #58168
2024-10-13 16:47:02 +00:00
Paul Gschwendtner 19369d78ba refactor(migrations): share best effort logic between input and query migration (#58168)
Allows us to easily implement a best effort mode for both migrations.

PR Close #58168
2024-10-13 16:47:02 +00:00
Paul Gschwendtner 349de49964 refactor(migrations): properly detect and skip queries with accessors (#58168)
Currently the migration does not detect queries declared on accessors.
This is fine as we cannot migrate them anyway.

We should still try to detect them and mark them as incompatible so that
we could insert TODOs.

PR Close #58168
2024-10-13 16:47:02 +00:00
Paul Gschwendtner f84e8ddcd9 ci: disable bazel-saucelabs job (#58162)
Disables the `bazel-saucelabs` job in `main`, and re-uses the PR legacy
saucelabs job to run on `main` instead (which is much more stable and
reliable).

PR Close #58162
2024-10-11 14:07:35 +00:00
Paul Gschwendtner a59dbb7cd6 refactor(migrations): assign incompatibility reasons for query migration (#58152)
Instead of skipping queries without any reasoning, we should categorize
fields that couldn't be migrated. This is also important for the VSCode
integration— similar to how it's done with the inputs migration.

We are fully sharing the problematic pattern detection etc. This means
we are also sharing the enum. Not super ideal, but enables the best
sharing of code.

PR Close #58152
2024-10-11 11:23:38 +00:00
Angular Robot b1985932e7 build: update io_bazel_rules_sass digest to 583fc8c (#58155)
See associated pull request for more information.

PR Close #58155
2024-10-11 10:37:56 +00:00
Kristiyan Kostadinov fc6c76ac67 refactor(core): add internal utility to resolve the component name of a node (#58148)
Adds a utility, meant for internal consumption, that will return the class name of the closest component node to an element.

PR Close #58148
2024-10-11 07:04:40 +00:00
Kristiyan Kostadinov fb44323c51 fix(compiler-cli): incorrectly generating relative file paths on case-insensitive platforms (#58150)
We're using `path.relative` to compute a relative path between a `SourceFile` and the one of the `rootDirs`. The problem is that the `rootDirs` get passed through `getCanonicalFileName` which lowercases the path in some platforms, while `SourceFile.fileName` is always case-insensitive. This yields a path outside of the project which we were ignoring.

This change passes the `SourceFile.fileName` before passing it through `path.relative` to ensure that we get a valid result.

PR Close #58150
2024-10-11 07:03:15 +00:00
Kristiyan Kostadinov 852c042520 refactor(compiler-cli): output HMR initializer code (#58150)
Adds the logic to the compiler that will output the HMR initializer code for each component, if enabled.

PR Close #58150
2024-10-11 07:03:15 +00:00
Kristiyan Kostadinov 6f7803a3ff refactor(compiler): add logic to generate the HMR initializer (#58150)
Adds the logic that will generate the `import` expression that will initializer HMR for a specific component.

PR Close #58150
2024-10-11 07:03:15 +00:00
vladboisa 08b4a8af6e docs: move JSDoc below constructor (#57187)
Move the JSDoc above transform signature for correct view

Fixes #56349

refactor: format file

PR Close #57187
2024-10-10 12:37:35 +00:00
Steven Tucker a89fd30690 docs: Updated event-listeners.md doc to use correct term, even -> every (#57964)
event time -> every time

PR Close #57964
2024-10-10 12:36:41 +00:00
arturovt da6970d2cb refactor(docs-infra): allow table of contents to be GCed (#58034)
This commit updates the table of contents functionality to clean up correctly whenever the user
navigates to other pages and nodes are removed from the DOM.

Currently, calling `renderComponent` with the `TableOfContents` keeps creating a new table of contents
component without removing the previous one, as they are created manually.

This leads to memory leaks because the components cannot be collected properly, even if the user
navigates to the home page where there is no TOC component.

PR Close #58034
2024-10-10 12:33:51 +00:00
Matthieu Riegler 57134dd344 refactor(core): drop the Mutable utility type. (#58124)
The complexity of this type isn't necessary, `Writable` is well suited where it was used.

PR Close #58124
2024-10-10 10:47:50 +00:00
reosablo 410ed699a2 docs(core): fix description about signal value equality (#56472)
PR Close #56472
2024-10-10 10:24:32 +00:00
Jaime González Fábregas b27045a124 docs(docs-infra): substitute string interpolation on json data with actual value (#57626)
substitute "${this.baseUrl}" with "https://angular.dev/assets/images/tutorials/common" in the photo url on the json data provided on the hands on tutorial in the webpage "https://angular.dev/tutorials/first-app/14-http". The previous json content caused the images to fail loading.

PR Close #57626
2024-10-10 10:22:34 +00:00
Paul Gschwendtner 6530c5ecb0 release: cut the v19.0.0-next.9 release 19.0.0-next.9 2024-10-10 12:16:51 +02:00