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

Support For AngularNodeAppEngine #335

Open
Char2sGu opened this issue Dec 29, 2024 · 2 comments
Open

Support For AngularNodeAppEngine #335

Char2sGu opened this issue Dec 29, 2024 · 2 comments

Comments

@Char2sGu
Copy link

Is your feature request related to a problem? Please describe

The new AngularNodeAppEngine in developer preview enables hybrid rendering, and also provides the request/response context to build-in tokens from the @angular/core package. However, with AngularNodeAppEngine, we are no longer allowed to configure custom providers in servrer.ts.

Describe the solution you'd like

Should try to fetch the request information from the built-in REQUEST token:

import { REQUEST } from '@angular/core';
import { REQUEST as NGX_COOKIE_REQUEST } from 'ngx-cookie-service-ssr';
    {
      provide: NGX_COOKIE_REQUEST,
      useFactory: (request = inject(REQUEST)) => ({
        headers: {
          cookie: request?.headers.get('cookie') ?? '',
        },
      }),
    },

Describe alternatives you've considered

Document the usage with AngularNodeAppEngine.

Additional context

No response

Copy link

Hello 👋 @Char2sGu
Thank you for raising an issue. We will investigate into the issue and get back to you as soon as possible. Please make sure you have given us as much context as possible.
Feel free to raise a PR if you can fix the issue

@bballardkele
Copy link

Should try to fetch the request information from the built-in REQUEST token

I agree with the proposed solution. The package should probably pivot to using the tokens provided by the @angular/core package instead of exposing shared tokens from @ngx-cookie-service-ssr. It's interesting that the Angular team removed these tokens as a part of the rebranding/retirement of Universal, just to bring them back in the v19 preview.

Also see the RESPONSE_INIT token which if I'm understanding correctly will need to replace the @ngx-cookie-service-ssr RESPONSE token introduced in #320 . https://angular.dev/guide/hybrid-rendering#accessing-request-and-response-via-di

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

No branches or pull requests

2 participants