Commit graph

26437 commits

Author SHA1 Message Date
Angular Robot
de0bdeea4c build: update github/codeql-action action to v2.2.6 (#49420)
See associated pull request for more information.

PR Close #49420
2023-03-15 17:01:00 -07:00
Alan Agius
2d7f48cf74 test: fix misconfiguration in tests (#49391)
Currently, tests are tested twice using "production" like configuration. This commit disabled "optimization" for non production builds.

PR Close #49391
2023-03-15 16:59:50 -07:00
Kristiyan Kostadinov
1a6ca68154 feat(compiler): add support for compile-time required inputs (#49304)
Adds support for marking a directive input as required. During template type checking, the compiler will verify that all required inputs have been specified and will raise a diagnostic if one or more are missing. Some specifics:
* Inputs are marked as required by passing an object literal with a `required: true` property to the `Input` decorator or into the `inputs` array.
* Required inputs imply that the directive can't work without them. This is why there's a new check that enforces that all required inputs of a host directive are exposed on the host.
* Required input diagnostics are reported through the `OutOfBandDiagnosticRecorder`, rather than generating a new structure in the TCB, because it allows us to provide a better error message.
* Currently required inputs are only supported during AOT compilation, because knowing which bindings are present during JIT can be tricky and may lead to increased bundle sizes.

Fixes #37706.

PR Close #49304
2023-03-15 16:59:24 -07:00
Andrew Kushnir
22b895a5b1 refactor(core): add hydration logic for view containers (#49382)
This commit implements hydration support for view containers, which should make `*ngIf`, `*ngFor` and other structural directive work with hydration.

The logic also respects the `ngSkipHydration` flag and skips hydration in such cases.

PR Close #49382
2023-03-14 14:22:09 -07:00
Andrew Kushnir
02359f0814 refactor(core): adding a DEHYDRATED_VIEWS field to LContainer (#49382)
This commit adds a new slot to the `LContainer` header to store references to dehydrated views.

PR Close #49382
2023-03-14 14:22:09 -07:00
Andrew Kushnir
a6e38d3ae7 refactor(core): serialize info about views in view containers (#49382)
This commit updates the serialization logic to include information about views from view containers (based on underlying LContainer info). The information is needed during hydration to pick a correct instance of dehydrated view (this logic will be implemented in a followup commit).

PR Close #49382
2023-03-14 14:22:08 -07:00
Andrew Kushnir
a09fa46d4a refactor(core): serialize info about templates used to create embedded views (#49382)
This commit updates the serialization logic to include information about templates that were used to create embedded views. The information is needed during hydration to pick a correct instance of dehydrated view (this logic will be implemented in a followup commit).

PR Close #49382
2023-03-14 14:22:08 -07:00
Andrew Scott
ed110a05f0 docs: remove deprecation notes for removed APIs (#49239)
This commit removes the deprecation notes from the deprecations guide for APIs that have been removed.

PR Close #49239
2023-03-14 10:58:13 -07:00
Andrew Scott
c0b1b7becf fix(router): Remove deprecated ComponentFactoryResolver from APIs (#49239)
BREAKING CHANGE:
`ComponentFactoryResolver` has been removed from Router APIs.
Component factories are not required to create an instance of a component
dynamically. Passing a factory resolver via resolver argument is no longer needed
and code can instead use `ViewContainerRef.createComponent` without the
factory resolver.

PR Close #49239
2023-03-14 10:58:12 -07:00
Esteban Gehring
f07533f371 docs(upgrade): mark lifecycle methods as nodoc (#49416)
PR Close #49416
2023-03-14 09:41:35 -07:00
Esteban Gehring
a240dfce7b docs(common): mark lifecycle methods as nodoc (#49416)
PR Close #49416
2023-03-14 09:41:35 -07:00
Kristiyan Kostadinov
be97c87023 refactor(compiler): required inputs prerequisite refactors (#49333)
Based on the discussion in https://github.com/angular/angular/pull/49304#discussion_r1124732608. Reworks the compiler internals to allow for additional information about inputs to be stored. This is a prerequisite for required inputs.

PR Close #49333
2023-03-14 09:27:49 -07:00
Alex Rickabaugh
0814f20594 feat(core): introduce runInInjectionContext and deprecate prior version (#49396)
With the introduction of `EnvironmentInjector`, we added an operation to run
a function with access to `inject` tokens from that injector. This operation
only worked for `EnvironmentInjector`s and not for element/node injectors.

This commit deprecates `EnvironmentInjector.runInContext` in favor of a
standalone API `runInInjectionContext`, which supports any type of injector.

DEPRECATED: `EnvironmentInjector.runInContext` is now deprecated, with
`runInInjectionContext` functioning as a direct replacement:

```typescript
// Previous method version (deprecated):
envInjector.runInContext(fn);
// New standalone function:
runInInjectionContext(envInjector, fn);
```

PR Close #49396
2023-03-14 09:25:57 -07:00
Angular Robot
3d2351c5f7 build: update io_bazel_rules_sass digest to aa03944 (#49397)
See associated pull request for more information.

PR Close #49397
2023-03-14 09:25:16 -07:00
Alan Agius
b20ee9d47c refactor(core): remove duplicate call to getComponentId (#49390)
`getComponentId` is called twice by mistake.

f7c266c4e6/packages/core/src/render3/definition.ts (L319)

PR Close #49390
2023-03-14 09:23:52 -07:00
Alan Agius
056d68002f feat(platform-server): add provideServerSupport function to provide server capabilities to an application (#49380)
This commit adds the `provideServerSupport()` function that returns the `EnvironmentProviders` needed to setup server rendering without NgModules.

PR Close #49380
2023-03-14 09:23:13 -07:00
Andrew Scott
4e098fa8a7 refactor(core): move Zone providers to a single provider function (#49373)
This commit moves the providers for `NgZone`-based change detection to a
single provider function. This function is currently called by default
in all places where `NgZone` was provided
(`bootstrapApplication`, `bootstrapModule`, and `TestBed`).

When we want to make Angular applications zoneless by default, we
can make a public provider method that has to be used in order to enable
the zone change detection features. When this method is not called,
Angular would use `NoopNgZone` by default and not initialize any
subscriptions to the `NgZone` stability events.

Side note: There are actually two places that `NgZone` is provided for `TestBed`
(providers in `compileTestModule` and `BrowserTestingModule`). This
likely doesn't need to be in both locations.

PR Close #49373
2023-03-14 09:20:53 -07:00
Andrew Scott
67c5272946 refactor(core): Extract microtask subscription and CD scheduling from ApplicationRef (#49373)
This refactor extracts the `NgZone` microtask subscription to a new
"ChangeDetectionScheduler". With this change, `ApplicationRef` not
longer injects `NgZone` directly. In the future, we can update the
providers that depend on `NgZone` to not use zones by default but
instead require a specific-opt in.

PR Close #49373
2023-03-14 09:20:53 -07:00
Andrew Scott
4d3bfcd570 refactor(core): Extract ApplicationRef error handling to a new internal token (#49373)
This extracts the zone-based error handling in `ApplicationRef` to a new
token. This works towards removing `NgZone` as a dependency in
`ApplicationRef`.

PR Close #49373
2023-03-14 09:20:52 -07:00
Andrew Scott
d423101a71 refactor(core): Move ApplicationRef.isStable implementation to a provider (#49373)
`ApplicationRef.isStable` is entirely powered by the state of `NgZone`.
The implementation should be part of `NgZone` code rather than built in
to `ApplicationRef`. In the future, `ApplicationRef.isStable` should
likely be removed in favor of the API living on the `NgZone`
class/interface instead.

PR Close #49373
2023-03-14 09:20:52 -07:00
JiaLiPassion
5a2b6227b3 fix(zone.js): revert Mocha it.skip, describe.skip method patch (#49329)
In the previous commit https://github.com/angular/angular/pull/45047
The `it.skip` and `describe.skip` is wrongly deleted, should keep
the patch for these methods.

PR Close #49329
2023-03-14 09:13:57 -07:00
angular-robot[bot]
daaed8943c
build: update CODE_OF_CONDUCT.md to match the content of angular/.github 2023-03-13 21:07:51 +00:00
Paul Gschwendtner
7dbe328b28 docs: release notes for the v14.3.0 release 2023-03-13 10:59:08 +01:00
Angular Robot
c10962b713 build: update cross-repo angular dependencies (#49388)
See associated pull request for more information.

PR Close #49388
2023-03-13 09:24:13 +00:00
Alan Agius
a50ff60bff build: update cross-repo angular dependencies (#49376)
See associated pull request for more information.

(cherry picked from commit ba630a3c65)

PR Close #49376
2023-03-09 11:32:03 -08:00
Julien Saguet
5e7fc259ea feat(service-worker): add function to provide service worker (#48247)
add function `provideServiceWorker` to register a service worker in standalone applications without using `ServiceWorkerModule.register()`

PR Close #48247
2023-03-09 18:13:50 +00:00
Alan Agius
86fc4d3e98 refactor(platform-browser): remove internal TRANSITION_ID token (#48253)
This was a mirror copy of the `APP_ID` token.

PR Close #48253
2023-03-09 09:33:34 -08:00
Alan Agius
9165ff2517 fix(platform-browser): reuse server generated component styles (#48253)
Prior to this change component styles generated on the server where removed prior to the client side component being rendered and attached it's own styles. In some cases this caused flickering. To mitigate this `initialNavigation: enabledBlocking'` was introduced which allowed the remove of server styles to be defer to a latter stage when the application has finished initialization.

This commit changes the need for this, by not removing the server generated component styles and reuse them for client side rendering.

PR Close #48253
2023-03-09 09:33:34 -08:00
Alan Agius
0e5f9ba6f4 fix(core): generate consistent component IDs (#48253)
Prior to this change the component IDs where generated based on a counter. This is problematic as there is no guarantee that a component will get the same ID that was assigned on the server when generated on the client side.

This is paramount to be able to re-use the component styles generated on the server.

PR Close #48253
2023-03-09 09:33:34 -08:00
Virginia Dooley
0b71b0a9de docs: New doc: Understanding communicating with backend services using HTTP (#49294)
PR Close #49294
2023-03-09 09:21:13 -08:00
Virginia Dooley
7bde9db4d4 docs: New doc extract from original HTTP doc to be retired. (#48914)
PR Close #48914
2023-03-09 09:19:04 -08:00
Virginia Dooley
0a3ac9d6ea docs: delete outdated link. (#48909)
PR Close #48909
2023-03-09 09:17:01 -08:00
Virginia Dooley
4f86e7ae90 docs: delete or revise outdated links. (#48909)
PR Close #48909
2023-03-09 09:17:01 -08:00
Virginia Dooley
ee060c5377 docs: New doc extract from original HTTP doc to be retired. (#48909)
PR Close #48909
2023-03-09 09:17:01 -08:00
Matthieu Riegler
addd7f6249 refactor(dev-infra): remove obsolete todos (#49362)
These todos do not apply anymore, let's remove them.

PR Close #49362
2023-03-08 15:39:55 -08:00
Matthieu Riegler
a9904c2d2e docs: Remove RenderComponentType from the depreciation list. (#49363)
`RenderComponentType` was removed by #33019

PR Close #49363
2023-03-08 15:39:02 -08:00
Angular Robot
0e070dc223 docs: update events (#49366)
Generated `events.json` with the latest events retrieved from the Firebase DB.

Closes #49355

PR Close #49366
2023-03-08 21:54:24 +00:00
Angular Robot
3f210d8720 build: update eslint dependencies to v5.54.1 (#49348)
See associated pull request for more information.

PR Close #49348
2023-03-08 13:08:34 -08:00
Alan Agius
852558366d refactor(core): split ɵɵdefineDirective and ɵɵdefineComponent (#49350)
Before this change `ɵɵdefineDirective` called `ɵɵdefineComponent` under the hood. This is problematic for the consistent component id generation as it could result in hash collisions for certain directives. Directives however do not require an id.

This changes moves common definition generation logic into a separate function that is re-used in `ɵɵdefineDirective` and `ɵɵdefineComponent`.

PR Close #49350
2023-03-08 13:07:53 -08:00
Jessica Janiuk
c2edcce436 release: cut the v16.0.0-next.2 release 2023-03-08 10:56:53 -08:00
Jessica Janiuk
dafebcdbd8 docs: release notes for the v15.2.2 release 2023-03-08 10:46:12 -08:00
Angular Robot
8e76107b94 build: update cross-repo angular dependencies (#49367)
See associated pull request for more information.

PR Close #49367
2023-03-08 18:00:27 +00:00
Paul Gschwendtner
c241f63e8d refactor(compiler-cli): remove unused class decorator downlevel code (#49351)
The decorator downlevel transform is never used for actual class
decorators because Angular class decorators rely on immediate execution
for JIT. Initially we also supported downleveling of class decorators
for View Engine library output, but libraries are shipped using partial
compilation output and are not using this transform anymore.

The transform is exclusively used for JIT processing, commonly for
test files to help ease temporal dead-zone/forward-ref issues. We can
remove the class decorator downlevel logic to remove technical debt.

PR Close #49351
2023-03-08 17:59:12 +00:00
Matthieu Riegler
daaf0fd2f6 refactor(core): Remove isObservable() in favor isSubscribable(). (#49295)
The private util `isObservable` was actually just testing the same thing as`isSubscribable()`. As the implementation is closer to the function's name, let's only keep ``isSubscribable`.

PR Close #49295
2023-03-08 17:58:19 +00:00
Jessica Janiuk
5944f5d21e refactor(core): skip hydration annotation (#49345)
This adds the ngSkipHydration annotation, which allows users to
opt hydration boundaries out of hydration. This enables incremental
adoption of hydration by letting users skip hydration on components
that have implementation issues that conflict with hydration.

co-authored-by: AndrewKushnir <akushnir@google.com>

PR Close #49345
2023-03-08 17:56:43 +00:00
Angular Robot
984d0f49b5 build: update cross-repo angular dependencies (#49188)
See associated pull request for more information.

PR Close #49188
2023-03-08 01:54:00 +00:00
Andrew Kushnir
8e0a087674 refactor(core): hydration logic for <ng-container>s (#49303)
This commit incrementally builds on top of #49285 and adds the logic to hydrate <ng-container>s and their contents. This implementation supports simple <ng-container>s that don't have any Angular features (like *ngIf/*ngFor, etc) and are not content-projected.

The subsequent commits will extend the logic further to support more complex scenarios.

PR Close #49303
2023-03-07 23:56:45 +00:00
Matthieu Riegler
436050fcaa docs(docs-infra): Split Error by categories & sort by code. (#49343)
* 2 categories : Runtime errors and Compiler Errors.
* Numeric sort on error code.

PR Close #49343
2023-03-07 19:18:01 +00:00
Sai Kartheek Bommisetty
7749b19e90 docs: update toh-pt5.md (#49307)
PR Close #49307
2023-03-07 19:17:24 +00:00
Vinit Neogi
50a1f80a4d docs(docs-infra): missing "is" in glossary (#49356)
documentation glossary for view hierarchy is missing a "is" to be grammatically correct

Fixes #49352

PR Close #49356
2023-03-07 19:16:41 +00:00