From e6b687b041ecac8c53c268d5d2b838e902e01782 Mon Sep 17 00:00:00 2001 From: lenny Date: Sat, 23 Nov 2024 13:18:39 +0100 Subject: [PATCH 1/2] feat: update docs --- README.md | 8 ++++++++ angular.json | 2 +- projects/example/src/app/app.config.server.ts | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5d8175..7a7ddb9 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,14 @@ export class DemoComponent { } ``` +## Known Issues +* **Headers are not forwarded when performing requests in ssr.** + + _Add this provider to your `app.config.server.ts` file to fix this issue:_ + ```typescript + provideServerRoutesConfig([{path: '**', renderMode: RenderMode.Server}]) + ``` + ## TODOs 📝 - [ ] Additional Unit Tests for SSR and WebSocket Subscriptions. diff --git a/angular.json b/angular.json index 2fea3da..1fbd5e6 100644 --- a/angular.json +++ b/angular.json @@ -69,7 +69,7 @@ ], "scripts": [], "server": "projects/example/src/main.server.ts", - "outputMode": "server", + "externalDependencies": [""], "ssr": { "entry": "projects/example/src/server.ts" } diff --git a/projects/example/src/app/app.config.server.ts b/projects/example/src/app/app.config.server.ts index ddd0d86..453274f 100644 --- a/projects/example/src/app/app.config.server.ts +++ b/projects/example/src/app/app.config.server.ts @@ -1,9 +1,13 @@ import {ApplicationConfig, mergeApplicationConfig} from '@angular/core'; import {provideServerRendering} from '@angular/platform-server'; import {appConfig} from './app.config'; +import {provideServerRoutesConfig, RenderMode} from '@angular/ssr'; const serverConfig: ApplicationConfig = { - providers: [provideServerRendering()] + providers: [ + provideServerRendering(), + provideServerRoutesConfig([{path: '**', renderMode: RenderMode.Server}]) + ] }; export const config = mergeApplicationConfig(appConfig, serverConfig); From 98c0a0101993d8b305de4cd1090048d58793681a Mon Sep 17 00:00:00 2001 From: lenny Date: Sun, 24 Nov 2024 11:54:03 +0100 Subject: [PATCH 2/2] feat: fix typing for subscriptions --- projects/ngx-trpc/src/lib/rxjs-proxy/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts b/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts index c2b8ed8..0ec39a0 100644 --- a/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts +++ b/projects/ngx-trpc/src/lib/rxjs-proxy/types.ts @@ -24,4 +24,4 @@ export interface TRPCSubscriptionObserver { onComplete: () => void; } -export type YieldType = T extends AsyncGenerator ? Y : never; +export type YieldType = inferAsyncIterableYield;