angular/packages/platform-server/src
Alex Rickabaugh 7de1469be6 feat(core): introduce EnvironmentProviders wrapper type (#47669)
This commit introduces a new type `EnvironmentProviders` which can be used
in contexts where Angular accepted `Provider`s destined for
`EnvironmentInjector`s. This includes contexts such as `@NgModule.providers`
and `Route.providers`.

The new type is useful for preventing such providers from accidentally
ending up in `@Component.providers`. It can be used as the return type of
provider functions (such as `provideRouter`) to enforce this safety.

Because `Provider` allows `any[]` nested arrays, the compile-time safety
provided by `EnvironmentProviders` is easily circumvented. However, the
runtime shape of `EnvironmentProviders` is not compatible with component
injectors and will result in a runtime error if it leaks through (NG0207).

A new function `makeEnvironmentProviders` is used to construct this new type
from an array of providers.

The existing `importProvidersFrom` operation previously returned a very
similar type `ImportedNgModuleProviders` which had the same goal. This
machinery is switched over to use the new `EnvironmentProviders` interface
instead (in fact, `ImportedNgModuleProviders` is now just an alias to
`EnvironmentProviders`).

PR Close #47669
2022-10-07 14:03:13 -07:00
..
domino_adapter.ts refactor: replace deprecated HTMLDocument with Document (#45282) 2022-03-08 13:12:14 -08:00
http.ts refactor(http): introduce the functional interceptors API (#47502) 2022-10-06 19:02:45 +00:00
location.ts fix(common): cleanup location change listeners when the root view is removed (#40867) 2021-03-04 13:09:04 -08:00
platform-server.ts feat(platform-server): implement renderApplication function (#45785) 2022-04-29 17:18:54 -04:00
platform_state.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
private_export.ts refactor(platform-server): add a marker to specify how a page was rendered (#47103) 2022-09-12 19:05:48 -07:00
server.ts feat(platform-server): support document reference in render functions (#47032) 2022-08-04 13:37:54 -07:00
server_events.ts perf(core): minor improvements to listener instructions (#41807) 2021-04-30 14:14:00 -07:00
server_renderer.ts fix(platform-server): invalid style attribute being generated for null values (#46433) 2022-06-21 11:54:52 -07:00
styles_host.ts refactor(platform-server): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:15 -07:00
tokens.ts feat(platform-server): implement renderApplication function (#45785) 2022-04-29 17:18:54 -04:00
transfer_state.ts feat(platform-browser): add isEmpty method to the TransferState class (#46915) 2022-07-22 09:17:47 +00:00
types.d.ts refactor(platform-server): switch from dynamic require to import statement (#43431) 2021-10-01 18:28:43 +00:00
utils.ts feat(core): introduce EnvironmentProviders wrapper type (#47669) 2022-10-07 14:03:13 -07:00
version.ts docs: fix package name in version.ts files in different packages (#41208) 2021-05-10 10:26:34 -04:00