forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Create a new pull request by comparing changes across two branches #246
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a relativelly small refactoring to a couple of adev components. The goal here is to use new reactive APIs in the idiomatic way. PR Close #58357
… Angular (#58405) Disables the standalone by default behavior in the compiler when running against and older version of Angular. This is necessary, because the language service may be using the latest version of the compiler against and older version of core in a particular workspace. PR Close #58405
…migrations (#58413) Fixes that the migrations weren't properly determing the highest block of multiple shared references. The logic was flawed by checking the `start` indices; because we also need to respect that the blocks should enclose all references; and the block practically is a common ancestor. This is not guaranteed without this commit. Note: The logic assumes that all references are part of the same control flow container; this is verified. PR Close #58413
…gnal migration (#58413) In 1P, we saw that a type of a target wasn't resolvable, referenced in a `hostBindings#directive` field. This breaks the entire pipeline; so we should handle gracefully but report an error. Worst case scenario here is that we would miss some references to the given directive/component. This is acceptable and we can continue investigation why that given target was broken; especially since the file was part of the target inputs- but seemingly not in the `tsconfig`. PR Close #58413
This change fixes a bug where the output migration was interacting with the InputManager utility in the way that was resulting in incorrect import replacements. The fix consists of making sure that a new ImportManager instance is created for each and every file containing @output declarations. PR Close #58414
This commit adds the `ngServerMode` as global, which allows for the tree-shaking of server-only code from the bundles. When this flag is unset at runtime, server-specific code will be excluded by Closure, optimizing bundle size. **Internal Angular Flag:** This is an internal Angular flag (not a public API), avoid relying on it in application code. PR Close #58386
This implements a queue rather than a recursive call, which enables proper cleanup timing for defer block registry. PR Close #58419
This cleans up much of incremental.ts and adds documentation. PR Close #58430
This commit updates the code of the incremental hydration feature to make the `DeferBlockRegistry` class tree-shakable. The class is only needed for hydration cases and it should not be included into client bundles for client-only apps. PR Close #58424
Switches to referencing the core environment directly in the generated code, instead of having to duplicate it. PR Close #58444
The `ExternalReference.runtime` field wasn't being used anywhere. PR Close #58444
…58468) The unused imports diagnostic reports once on the entire initializer and then again once per unused imports. This ends up being a bit hard to follow, because in a lot of cases the code snippet looks identical. These changes switch to highlighting the `imports:` part of the property declaration and only highlighting the unused imports without a message. PR Close #58468
Since the unused imports diagnostic setup has changed, we need to update the code fix to account for it. PR Close #58468
Fixes external link for 'Everything you need to know about the "ExpressionChangedAfterItHasBeenCheckedError" error' on the NG0100 error page. Domain has changed from indepth.dev to angularindepth.com PR Close #58462
Currently you pass in the ORG and it still tries to publish to Angular rather than your ow ORG repo that gets created PR Close #58408
See associated pull request for more information. PR Close #58420
…ure that can have keys (#51739) named as the values of the `TaskType` type. The Closure Compiler used at Google has a property renaming optimization that can change the property names when minifying code. Having the correct type helps the TSJS team that develops a tool to identfy property renaming issues directly in TypeScript. Signed-off-by: Costin Sin <[email protected]> PR Close #51739
) This change modifies the execution level of `postUpgradeTasks` in Renovate. By setting `executionMode` to `branch`, the task will run once per branch, rather than for each dependency update. This helps streamline tasks across dependencies by consolidating them at the branch level. PR Close #58470
Due to a bug in Renovate (see: https://github.com/sarunint/renovate/blob/276a01fdd743d270fd2662cabb3b0e1e465aec83/lib/util/exec/common.ts#L50-L53), post tasks are incorrectly running in parallel. This causes 'yarn install' to overlap with 'yarn ng-dev misc update-generated-files', resulting in incomplete installs before file updates start. PR Close #58472
Adjusts the HMR initialization to avoid the edge case where a developer makes change to a non-rendered component that exists in a lazy loaded chunk that has not been loaded yet. The changes include:
* Moving the `import` statement out into a separate function.
* Adding a null check for `d.default` before calling `replaceMEtadata`.
* Triggering the `import` callback eagerly on initialization.
Example of the new generated code:
```js
(() => {
function Cmp_HmrLoad(t) {
import(
/* @vite-ignore */ "/@ng/component?c=test.ts%40Cmp&t=" + encodeURIComponent(t)
).then((m) => m.default && i0.ɵɵreplaceMetadata(Cmp, m.default, [/* Dependencies go here */]));
}
(typeof ngDevMode === "undefined" || ngDevMode) && Cmp_HmrLoad(Date.now());
(typeof ngDevMode === "undefined" || ngDevMode) &&
import.meta.hot &&
import.meta.hot.on("angular:component-update", (d) => {
if (d.id === "test.ts%40Cmp") {
Cmp_HmrLoad(d.timestamp);
}
});
})();
```
PR Close #58465
See associated pull request for more information. PR Close #58477
…8493) The following provider: ```ts { provide: APP_INITIALIZER, useFactory: (initService: InitService) => { return () => initService.init() }, deps: [InitService], multi: true } ``` was migrated into: ```ts provideAppInitializer(() => { return ((initService: InitService) => { return () => initService.init() })(inject(InitService)); }) ``` This doesn't compile because there is an extra function: ``` ✘ [ERROR] TS2345: Argument of type '() => () => void' is not assignable to parameter of type '() => void | Observable<unknown> | Promise<unknown>'. Type '() => void' is not assignable to type 'void | Observable<unknown> | Promise<unknown>'. [plugin angular-compiler] src/app/app.config.ts:7:26: 7 │ ...ovideAppInitializer(() => { return ((initService: InitService) => { ``` It now migrates the provider into: ```ts provideAppInitializer(((initService: InitService) => { return () => initService.init() })(inject(InitService))) ``` PR Close #58493
…e matching (#58492) When the compiler generates the `HostDirectivesFeature`, it generates either an eager call (`ɵɵHostDirectivesFeature([])`) or a lazy call (`ɵɵHostDirectivesFeature(() => [])`. The lazy call is necessary when there are forward references within the `hostDirectives` array. Currently we resolve the lazy variant when the component definition is created which has been enough for most cases, however if the host is injected by one of its host directives, we can run into a reference error because DI is synchronous and the host's class hasn't been defined yet. These changes resolve the issue by pushing the lazy resolution later during directive matching when all classes are guanrateed to exist. Fixes #58485. PR Close #58492
This update corrects a grammatical error in the "CSS style properties" section of the template binding documentation. The sentence "You must create a new object instance when you modify these values in order to Angular to apply any updates" was updated to read correctly as "You must create a new object instance when you modify these values in order for Angular to apply any updates." This clarification helps improve readability and ensures the documentation communicates instructions accurately for readers. PR Close #58491
This updates the prettierrc to reflect how the code seems to already be formatted. I noticed that without this my IDE seemed to be introducing formatting changes on save. PR Close #58266
The manual replacement logic had a flaw and was inserting the imports several times.
For example:
```ts
import { APP_INITIALIZER, ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { InitService } from './init.service';
export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }),
{
provide: APP_INITIALIZER,
useFactory: (initService: InitService) => initService.init(),
deps: [InitService],
multi: true
},
{
provide: APP_INITIALIZER,
useFactory: (initService: InitService) => initService.init(),
deps: [InitService],
multi: true
}
]
};
```
produced:
```ts
import { ApplicationConfig, provideZoneChangeDetection, inject, provideAppInitializer }{ ApplicationConfig, provideZoneChangeDetection, inject, provideAppInitializer } from '@angular/core';
import { InitService } from './init.service';
export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }),
provideAppInitializer(() => { return ((initService: InitService) => initService.init())(inject(InitService)); }),
provideAppInitializer(() => { return ((initService: InitService) => initService.init())(inject(InitService)); })
]
};
```
It now produces proper imports:
```ts
import { ApplicationConfig, provideZoneChangeDetection, inject, provideAppInitializer } from '@angular/core';
```
PR Close #58456
See associated pull request for more information. PR Close #58506
…M components (#58482) Angular components that use ShadowDOM view encapsulation have an alternate execution path for adding component styles to the DOM that does not use the SharedStylesHost that all other view encapsulation modes leverage. To ensure that ShadowDOM components receive all defined styles, additional logic has been added to the ShadowDOM specific renderer to also cover external styles. PR Close #58482
Updated Angular CLI help contents. PR Close #58512
This file is only used to generate adev docs PR Close #58514
See associated pull request for more information. PR Close #58510
See associated pull request for more information. PR Close #58499
The `NG_STANDALONE_DEFAULT_VALUE` is no longer being patched internally and can be removed. PR Close #58478
…#58515) The use of relative imports vs. module imports and the existing mismatch can cause symbols to be duplicated in migrations. This is problematic as it breaks migration logic or compiler logic in the worst case. Long-term we will solve this by having a better Bazel toolchain where both relative and module imports can point to the same files; but in practice this is not the case right now. This commit fixes the fallback template logic in the signal input/queries migration; in case no type check block information is available. PR Close #58515
…module are discovered (#58515) Currently when application source code references e.g. an NgModule that points to references that aren't available, the compiler will break at runtime without any actionable/reasonable error. This could happen for example when a library is referenced in code, but the library is simply not available in the `node_modules`. Clearly, TypeScript would issue import diagnostics here, but the Angular compiler shouldn't break fatally. This is useful for migrations which may run against projects which aren't fully compilable. The compiler handles this fine in all cases, except when processing `.d.ts` currently... and the runtime exception invalides all other information of the program etc. This commit fixes this by degrading such unexpected cases for `.d.ts` metadata reading to be handled gracefully. This matches existing logic where the `.d.ts` doesn't necessarily match the "expecation"/"expected format". The worst case is that the Angular compiler will not have type information for some directives of e.g. a library that just isn't installed in local `node_modules`; compared to magical errors and unexpected runtime behavior. PR Close #58515
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information