Skip to content

Commit 39e29cf

Browse files
Prepare for zoneless development (#138)
* Prepare for zoneless development * fix tests --------- Co-authored-by: Grzegorz Krajniak <[email protected]>
1 parent 1a388a9 commit 39e29cf

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

projects/lib/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
branches: 90,
1111
functions: 95,
1212
lines: 95,
13-
statements: -4,
13+
statements: -5,
1414
},
1515
},
1616
moduleNameMapper: {

projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class CrdGatewayKcpPatchResolver {
1414
entityId?: string,
1515
kind?: string,
1616
) {
17-
if (nextNode.context.kcpPath) {
17+
if (nextNode.context?.kcpPath) {
1818
this.gatewayService.updateCrdGatewayUrlWithEntityPath(
1919
nextNode.context.kcpPath,
2020
);

projects/lib/services/resource/apollo-factory.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { GatewayService } from './gateway.service';
22
import { ResourceNodeContext } from './resource-node-context';
3-
import { Injectable, NgZone, inject } from '@angular/core';
3+
import { Injectable, inject } from '@angular/core';
44
import {
55
type ApolloClientOptions,
66
ApolloLink,
@@ -39,20 +39,24 @@ class SSELink extends ApolloLink {
3939
}
4040
}
4141

42+
const noopZone = {
43+
run: (fn: any) => fn(),
44+
runOutsideAngular: (fn: any) => fn(),
45+
} as any;
46+
4247
@Injectable({
4348
providedIn: 'root',
4449
})
4550
export class ApolloFactory {
4651
private httpLink = inject(HttpLink);
47-
private ngZone = inject(NgZone);
4852
private gatewayService = inject(GatewayService);
4953

5054
public readonly apollo = (
5155
nodeContext: ResourceNodeContext,
5256
readFromParentKcpPath = false,
5357
): Apollo =>
5458
new Apollo(
55-
this.ngZone,
59+
noopZone,
5660
this.createApolloOptions(nodeContext, readFromParentKcpPath),
5761
);
5862

0 commit comments

Comments
 (0)