Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new pull request by comparing changes across two branches #237

Merged
merged 98 commits into from
Sep 18, 2024

Conversation

GulajavaMinistudio
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

JeanMeche and others added 30 commits September 5, 2024 14:05
This change contains an additonal test that captures scenario
of the problematic .pipe usage outside of the directive class.

PR Close #57671
This change removes superflous .complete calls for the migrated outputs.

PR Close #57671
In case there are no signatures (like in an bare interface method), we display the implementation information.

PR Close #57622
…57192)

Refactor the visualizer and devtools-tabs components to use signal apis, in future we can make the components onPush and zoneless

PR Close #57192
…ation (#57672)

The migration took a type from the directive handler metadata, and
inserted it into a synthetic node for the new input() call. This works
perfectly fine, but in some cases, I saw some `T:VAE` comments attached
:exploding_head:  These are from the type checker which attached
synthetic comments to the exact same node.

PR Close #57672
…57672)

Whenever the signal input migration runs in VSCode, other inputs are
marked as incompatible via the config. Best effort mode currently skips
those incompatibilities and still migrates them. This is incorrect as
the config intends to skip those inputs, regardless of best effort mode.

PR Close #57672
…#57672)

Clarifies some details of the `shouldMigrateInput` configuration option
of the signal input migration.

PR Close #57672
…iting imports (#57672)

Currently whenever we apply the import manager changes in migations, we
leave the decision of multi-line or single-line to the TS printer.

This works, but in practice can cause signficiant file jumps/changes if
there are large imports that aren't wrapped for example, or the other
way around. We should try to be minimal here and preserve the existing
formatting, assuming that a multi-line import remains multi-line, while
a single-line import remains single-line if it already had many items in
a single line, intentionally.

PR Close #57672
…57672)

Currently the import manager always add a space after the import clause
brace. We should only do this if the existing import did the same.

PR Close #57672
…ignored (#57675)

Add a check to the language service that ignores specified diagnostic codes. This will be useful in g3.

The codes to ignore are exposed as part of the PluginConfig.

Fixes github.com/angular/vscode-ng-language-service/issues/1243

PR Close #57675
)

Modules like `core/primitives` are considered private and their symbols shouldn't be exposed nor linked in the docs.

PR Close #57611
…runing (#57684)

Currently during the module pruning stage of the standalone migration we assume that any leftover modules which only have `imports` and `exports` can safely be removed. That can be incorrect for the cases where some parts of the app were converted to standalone outside of the migration.

These changes update the logic so that such modules are replaced with the `exports` which are used within the specific component.

Fixes #51420.

PR Close #57684
With the framework enabling `standalone` by default (making module based an opt-in), the migration will migrate none-standalone existing components and add `standalone: false` to the decorator.

PR Close #57643
The typo in the [queries document](https://angular.dev/guide/components/queries#content-queries) has been corrected:
Queries never **pierce** through component boundaries.

PR Close #57228
…57677)

Migrations may resolve files in e.g. `blaze-out` and try to compute a
path for the file that is "recognizable" across workers. E.g. in one
worker, it may be the actual `.ts` file inside the source tree, while in
the other, the file may be inside `blaze-out`.

Tsurge currently expects project relative paths to be passed around.
Those project relative paths are currently only based on the single root
directory. Hence paths inside `blaze-out` would actually not be
recognizable.

The fix idea here is that we introduce a structure for Project files.
This structure will contain two fields:

- an ID of a file. This is similar to a module ID in the project. Those
  are resolved with respect to all root directories. This matches the
  conceptual virtual roots of `tsconfig#rootDirs`. The IDs can be used
  for matching files across workers, assuming those are executing using
  the same root directories, and handle the same overall project (e.g.
  google3).

- a path relative to the primary project root. Multiple roots may be
  configured, but the primary project root, is the directory that
  contains all others. See: `tsconfig.rootDir`. This path is NOT
  necessarily useful for matching files between stages etc, but it's
  useful for writing replacements for a given file to disk.

Note that those two things cannot be combind into one conceptual
"project relative path" because a path relative to the most appropriate
root directory cannot be used for safe replacements. E.g. consider a
replacement matches a file from a root directory like `/sub/`. The path
inside `/sub/` would then omit the `/sub/` and later on when writing
replacements, we wouldn't know which root directory it actually was part
of. Hence the concept of a "project root relative path" and the "ID".

ds

PR Close #57677
…raversal (#57719)

Instead of traversing the same paths multiple times, we should avoid
this extra work and optimize. This solves some issues in super large
files with extremely complex flow graphs. E.g. large `ngOnChanges`
functions in Pantheon.

For an example of a flow graph where it doesn't make sense to re-visit
nodes that have multiple incoming edges, see this internal screenshot:
https://screenshot.googleplex.com/6ub4e5e5gbzJAvH

PR Close #57719
See associated pull request for more information.

PR Close #57705
This addresses a minor issue where the "See whitespace in templates" phrase was not linked to its corresponding documentation section

PR Close #57718
…57711)

Currently several parsing errors in the new control flow (e.g. missing `track` expression) produce errors whose span targets the entire block. This can be really noisy in the IDE where the error can span many lines in the template.

These changes switch to highlighting just the start of the block.

PR Close #57711
This change contains a fix that takes into account comments
attached to outputs and preserves / removes those as needed.

PR Close #57691
This change uses the outputToObservable utility function to
convert migrated outputs to Observables. This happens only
in test files as it is a common practice to use RxJS to listen
to events raised by the component under test.

PR Close #57691
andriy101 and others added 29 commits September 16, 2024 11:28
Fixing typo: reactoring -> refactoring

PR Close #57726
See associated pull request for more information.

Closes #57806 as a pr takeover

PR Close #57810
This commit also adds the support of handling standalone proparties assigned by variables (or via shorthand assignments).

PR Close #57717
This commit marks the input, output and model APIs as stable
(along with the associated APIs) and thus exits the dev preview
phase for those APIs.

PR Close #57804
…ctly encapsulate for a component (#57809)

For component stylesheet hot module replacement scenarios, it will be necessarily to directly
encapsulate a component's stylesheet in a single operation. This currently requires the
consumer of the `encapsulateStyle` helper to use the internal Angular attribute values combined
with a find/replace over the entire stylesheet. To avoid both of these, the helper function now
has an optional second parameter which allows direct and full encapsulation of a style for a given
component when the component identifier is known.

PR Close #57809
Removes the `@let` syntax from developer preview.

PR Close #57813
See associated pull request for more information.

PR Close #57821
…sconfig (#57805)

Whenever the `ngc` binary is used directly to parse configurations, we
should try to respect the configured file system like we do in all other
places. Right now one spot where we escape the FS is for reading
directories to e.g. support tsconfig#includes.

This commit fixes this, implementing TypeScript's read directory method
leveraging the configured FS. The approach taken here was used for a
couple of months/years for Angular Material migrations and no issues
were found.

PR Close #57805
…chematic (#57805)

Introduces a new `ng generate` schematic for migration `@Input()`
declarations to signal inputs.

This migration is the same that is also integrated into the
VSCode extension.

Note: In a follow-up the documentation for this will be improved, and a
flag to report reasons on why certain inputs weren't migrated, is added.

PR Close #57805
…compiler (#57831)

Sets up the AST for hydrate triggers.

PR Close #57831
Finalizes compiler implementation of the new `hydrate` triggers by:
* Reworking the logic that was depending on the `hydrateSpan` to distinguish hydrate triggers from non-hydrate triggers.
* Fixing that the `hydrate when` trigger didn't have a `hydrateSpan`.
* Adding an error if a parameter is passed into a `hydrate` trigger.
* Add an error if other `hydrate` triggers are used with `hydrate never`.
* Replacing the `prefetch` and `hydrate` flags in the template pipeline with a `modifiers` field.
* Fixing an error that was being thrown when reifying `hydrate` triggers in the pipeline.
* Adding quick info support for the `hydrate` keyword in the language service.
* Adding some tests for the new logic.

PR Close #57831
…tion (#57835)

This commit prepares us for sharing the problematic pattern detection,
or inheritance checking. E.g. if a class is manually instantiated, using
certain APIs may not be considered safe. This logic will be shared in
the following commit.

PR Close #57835
This allows us to use the inheritance checks we built for the signal
input migration, inside the queries migration.

PR Close #57835
…ration (#57835)

Optional operations that don't run in the actual application compilation
would then cause fatal diagnostic errors breaking the compiler
initialization at runtime.

We should try to keep the migration as close as possible to the
application build.

PR Close #57835
…57837)

Clicking a clickable repo url in the contribution guide would make it simpler for new contributors to find the repository
PR Close #57837
See associated pull request for more information.

PR Close #57842
See associated pull request for more information.

PR Close #57843
…tion` (#57816)

Before this commit, `@let` decleration with an array where  mistaken for a component in the lView and throwing an unexpected error.

This commit fixes this.

PR Close #57816
…57855)

The versions for TypeScript should not be updated.

PR Close #57855
…57854)

Notably the inheritance checking is less complete as the one in the
input migration. That is because we can't efficiently determine query
fields in the analyze phase of compilation units. Unless we aggresively
consider every field of decorated classes as queries and complexify
the merged metadata significantly, we can't reliably check for cases
where a class is incompatible for migration because it overrides a
member from a class that is in a different compilation unit.

This is an acceptable limitation though (maybe for now), as worst case,
we would migrate the class and the other compilation unit would simply
break. Not ideal, but migrations are impossible to be 100% correct in
general— so not a surprise.

In the future, we may find ways to identify queries more reliably in
analyze phase already. e.g. if the compiler were to include this
metadata in the `.d.ts`, or if we decide to simply add this to the
metadata, accepting potential significant HDD increase.

PR Close #57854
The visitor that all extended diagnostics are based on hadn't implemented the `visitIcu` method which meant that it wasn't detecting any code inside of them.

Fixes #57838.

PR Close #57845
cherry-pick of #57681 that should have targeted `main`. This commit also fixes the wild card redirection

PR Close #57706
See associated pull request for more information.

PR Close #57860
The original effect design for Angular had one "bucket" of effects, which
are scheduled on the microtask queue. This approach got us pretty far, but
as developers have built more complex reactive systems, we've hit the
limitations of this design.

This commit changes the nature of effects significantly. In particular,
effects created in components have a completely new scheduling system, which
executes them as a part of the change detection cycle. This results in
behavior similar to that of nested effects in other reactive frameworks. The
scheduling behavior here uses the "mark for traversal" flag
(`HasChildViewsToRefresh`). This has really nice behavior:

 * if the component is dirty already, effects run following preorder hooks
   (ngOnInit, etc).
 * if the component isn't dirty, it doesn't get change detected only because
   of the dirty effect.

This is not a breaking change, since `effect()` is in developer preview (and
it remains so).

As a part of this redesigned `effect()` behavior, the `allowSignalWrites`
flag was removed. Effects no longer prohibit writing to signals at all. This
decision was taken in response to feedback / observations of usage patterns,
which showed the benefit of the restriction did not justify the DX cost.

The new effect timing is not yet enabled - a future PR will flip the flag.

PR Close #56501
@GulajavaMinistudio GulajavaMinistudio merged commit ee4aab3 into angular-indonesia:main Sep 18, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.