-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Description
Which @angular/* package(s) are relevant/related to the feature request?
platform-server
Description
When utilizing renderApplication() directly for e.g. implementing a custom SSR app render engine, it's not possible to apply the correct server-context like "ssr", as this requires to add the private SERVER_CONTEXT InjectionToken to platformProviders. The only way to apply the right context is to import the token in a hacky way by ignoring the export being prefixed with ɵ, marking it as private / not part of the public API.
The token was introduced in 2022 with this PR: #47103
As stated in this PR comment it sounds like a future exposure has already been considered:
We can make it fully public later once we test everything end-to-end and collect the feedback.
The above change was merged already 3 years ago, so it should now be safe to expose the token. It might be needed to also expose an Enum holding the possible values (similar to RenderMode but with the correct string representations instead of numeric values).
Proposed solution
Expose SERVER_CONTEXT InjectionToken in public API
Alternatives considered
none