Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions internal/heapsnapshot/src/HeapSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ export interface HeapSnapshotItemIndexProvider {
itemForIndex(newIndex: number): HeapSnapshotItem;
}

export class HeapSnapshotNodeIndexProvider
implements HeapSnapshotItemIndexProvider
{
export class HeapSnapshotNodeIndexProvider implements HeapSnapshotItemIndexProvider {
#node: HeapSnapshotNode;
constructor(snapshot: HeapSnapshot) {
this.#node = snapshot.createNode();
Expand All @@ -152,9 +150,7 @@ export class HeapSnapshotNodeIndexProvider
}
}

export class HeapSnapshotEdgeIndexProvider
implements HeapSnapshotItemIndexProvider
{
export class HeapSnapshotEdgeIndexProvider implements HeapSnapshotItemIndexProvider {
#edge: JSHeapSnapshotEdge;
constructor(snapshot: HeapSnapshot) {
this.#edge = snapshot.createEdge(0);
Expand All @@ -166,9 +162,7 @@ export class HeapSnapshotEdgeIndexProvider
}
}

export class HeapSnapshotRetainerEdgeIndexProvider
implements HeapSnapshotItemIndexProvider
{
export class HeapSnapshotRetainerEdgeIndexProvider implements HeapSnapshotItemIndexProvider {
readonly #retainerEdge: JSHeapSnapshotRetainerEdge;
constructor(snapshot: HeapSnapshot) {
this.#retainerEdge = snapshot.createRetainingEdge(0);
Expand Down Expand Up @@ -331,9 +325,7 @@ export class HeapSnapshotRetainerEdge implements HeapSnapshotItem {
}
}

export class HeapSnapshotRetainerEdgeIterator
implements HeapSnapshotItemIterator
{
export class HeapSnapshotRetainerEdgeIterator implements HeapSnapshotItemIterator {
readonly #retainersEnd: number;
retainer: JSHeapSnapshotRetainerEdge;
constructor(retainedNode: HeapSnapshotNode) {
Expand Down Expand Up @@ -631,9 +623,7 @@ export class HeapSnapshotNodeIterator implements HeapSnapshotItemIterator {
}
}

export class HeapSnapshotIndexRangeIterator
implements HeapSnapshotItemIterator
{
export class HeapSnapshotIndexRangeIterator implements HeapSnapshotItemIterator {
readonly #itemProvider: HeapSnapshotItemIndexProvider;
readonly #indexes: number[] | Uint32Array;
#position: number;
Expand Down Expand Up @@ -838,9 +828,7 @@ interface Retainers {
}

interface ArgumentsToComputeDominatorsAndRetainedSizes
extends SecondaryInitArgumentsStep1,
Retainers,
SecondaryInitArgumentsStep2 {
extends SecondaryInitArgumentsStep1, Retainers, SecondaryInitArgumentsStep2 {
// For each edge ordinal, this bit vector contains whether the edge
// should be used when computing dominators.
essentialEdges: Platform.TypedArrayUtilities.BitVector;
Expand All @@ -858,7 +846,8 @@ interface DominatorsAndRetainedSizes {
}

interface ArgumentsToBuildDominatedNodes
extends ArgumentsToComputeDominatorsAndRetainedSizes,
extends
ArgumentsToComputeDominatorsAndRetainedSizes,
DominatorsAndRetainedSizes {}

interface DominatedNodes {
Expand All @@ -872,9 +861,7 @@ interface DominatedNodes {

// The data transferred from the secondary worker to the primary.
interface ResultsFromSecondWorker
extends Retainers,
DominatorsAndRetainedSizes,
DominatedNodes {}
extends Retainers, DominatorsAndRetainedSizes, DominatedNodes {}

// Initialization work is split into two threads. This class is the entry point
// for work done by the second thread.
Expand Down
23 changes: 11 additions & 12 deletions internal/perf/src/memtest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@ const flags =
return flag as (typeof supportedFlags)[number];
}) || [];

export interface MemtestOptions
extends Omit<
LoadtestOptions,
| 'memorySnapshotWindow'
| 'idle'
| 'duration'
| 'calmdown'
| 'runs'
| 'server'
| 'query'
| 'pathname'
> {
export interface MemtestOptions extends Omit<
LoadtestOptions,
| 'memorySnapshotWindow'
| 'idle'
| 'duration'
| 'calmdown'
| 'runs'
| 'server'
| 'query'
| 'pathname'
> {
/**
* The GraphQL query to execute for the loadtest.
* Either `query` or `pathname` must be provided.
Expand Down
5 changes: 2 additions & 3 deletions internal/testing/src/composeLocalSchemasWithApollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ export interface ComposeLocalSchemaWithApolloSubgraphOpts {
export async function composeLocalSchemasWithApollo(
subgraphs: ComposeLocalSchemaWithApolloSubgraphOpts[],
) {
const { IntrospectAndCompose, LocalGraphQLDataSource } = await import(
'@apollo/gateway'
);
const { IntrospectAndCompose, LocalGraphQLDataSource } =
await import('@apollo/gateway');
let { supergraphSdl, cleanup } = await new IntrospectAndCompose({
subgraphs: subgraphs.map(({ name, url = `http://localhost/${name}` }) => ({
name,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
"eslint-plugin-n": "17.23.1",
"graphql": "16.12.0",
"jest": "30.2.0",
"prettier": "3.6.2",
"prettier": "3.7.1",
"prettier-plugin-pkg": "0.21.2",
"prettier-plugin-sh": "0.18.0",
"ts-jest": "29.4.5",
"ts-node": "10.9.2",
"typescript": "5.9.3",
"typescript-eslint": "8.47.0",
"typescript-eslint": "8.48.0",
"vite": "7.2.4",
"vite-tsconfig-paths": "patch:vite-tsconfig-paths@npm:5.1.3#~/.yarn/patches/vite-tsconfig-paths-npm-5.1.3-1736ca1872.patch",
"vitest": "3.2.4"
Expand Down
17 changes: 12 additions & 5 deletions packages/delegate/src/Subschema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ export function isSubschema(value: any): value is Subschema {
return Boolean(value.transformedSchema);
}

interface ISubschema<K = any, V = any, C = K, TContext = Record<string, any>>
extends SubschemaConfig<K, V, C, TContext> {
interface ISubschema<
K = any,
V = any,
C = K,
TContext = Record<string, any>,
> extends SubschemaConfig<K, V, C, TContext> {
transformedSchema: GraphQLSchema;
}

export class Subschema<K = any, V = any, C = K, TContext = Record<string, any>>
implements ISubschema<K, V, C, TContext>
{
export class Subschema<
K = any,
V = any,
C = K,
TContext = Record<string, any>,
> implements ISubschema<K, V, C, TContext> {
public name?: string;
public schema: GraphQLSchema;

Expand Down
9 changes: 5 additions & 4 deletions packages/federation/src/supergraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ const memoizedTypePrint = memoize1((type: GraphQLOutputType) =>
type.toString(),
);

export interface FederationSubschemaConfig
extends Omit<SubschemaConfig, 'executor' | 'name'> {
export interface FederationSubschemaConfig extends Omit<
SubschemaConfig,
'executor' | 'name'
> {
executor: Executor;
name: string;
endpoint: string;
Expand Down Expand Up @@ -1651,8 +1653,7 @@ export function getStitchingOptionsFromSupergraphSdl(
};
}

export interface GetStitchedSchemaFromSupergraphSdlOpts
extends GetStitchingOptionsFromSupergraphSdlOpts {
export interface GetStitchedSchemaFromSupergraphSdlOpts extends GetStitchingOptionsFromSupergraphSdlOpts {
supergraphSdl: string | DocumentNode;
onStitchingOptions?(
opts: ReturnType<typeof getStitchingOptionsFromSupergraphSdl>,
Expand Down
5 changes: 2 additions & 3 deletions packages/federation/tests/managed-federation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,8 @@ describe('Managed Federation', () => {

it.skipIf(process.env['LEAK_TEST'])('works with ApolloServer', async () => {
const { ApolloServer } = await import('@apollo/server');
const { startStandaloneServer } = await import(
'@apollo/server/standalone'
);
const { startStandaloneServer } =
await import('@apollo/server/standalone');
using gateway = new SupergraphSchemaManager({
fetch: mockSDL,
onStitchedSchema(schema) {
Expand Down
3 changes: 1 addition & 2 deletions packages/fusion-runtime/src/federation/supergraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ export function handleResolveToDirectives(
return mergedTypeDefs;
}

export interface HandleFederationSupergraphResult
extends UnifiedGraphHandlerResult {
export interface HandleFederationSupergraphResult extends UnifiedGraphHandlerResult {
getSubschema(subgraphName: string): SubschemaConfig;
}

Expand Down
12 changes: 7 additions & 5 deletions packages/gateway/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export type GatewayCLIConfig<
export interface GatewayCLISupergraphConfig<
TContext extends Record<string, any> = Record<string, any>,
> extends Omit<
GatewayConfigSupergraph<TContext>,
'supergraph' | 'cache' | 'reporting'
> {
GatewayConfigSupergraph<TContext>,
'supergraph' | 'cache' | 'reporting'
> {
/**
* SDL, path or an URL to the Federation Supergraph.
*
Expand All @@ -73,8 +73,10 @@ export interface GatewayCLISupergraphConfig<
reporting?: GatewayCLIHiveReportingOptions | GatewayGraphOSReportingOptions;
}

export interface GatewayCLIHiveReportingOptions
extends Omit<GatewayHiveReportingOptions, 'target' | 'token'> {
export interface GatewayCLIHiveReportingOptions extends Omit<
GatewayHiveReportingOptions,
'target' | 'token'
> {
/**
* The target to which the usage data should be reported to.
*
Expand Down
5 changes: 2 additions & 3 deletions packages/gateway/src/commands/handleOpenTelemetryCLIOpts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ export async function handleOpenTelemetryCLIOpts(
'Initializing OpenTelemetry SDK',
);

const { openTelemetrySetup, HiveTracingSpanProcessor } = await import(
'@graphql-hive/plugin-opentelemetry/setup'
);
const { openTelemetrySetup, HiveTracingSpanProcessor } =
await import('@graphql-hive/plugin-opentelemetry/setup');
const processors: SpanProcessor[] = [];

const logAttributes = {
Expand Down
50 changes: 20 additions & 30 deletions packages/gateway/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,19 @@ export async function getBuiltinPluginsFromConfig(
plugins.push(useJWT(config.jwt));
}
if (config.prometheus) {
const { default: useMeshPrometheus } = await import(
'@graphql-mesh/plugin-prometheus'
);
const { default: useMeshPrometheus } =
await import('@graphql-mesh/plugin-prometheus');
plugins.push(useMeshPrometheus({ ...config.prometheus, log: ctx.log }));
}
if (config.openTelemetry) {
const { useOpenTelemetry } = await import(
'@graphql-hive/plugin-opentelemetry'
);
const { useOpenTelemetry } =
await import('@graphql-hive/plugin-opentelemetry');
plugins.push(useOpenTelemetry({ ...config.openTelemetry, log: ctx.log }));
}

if (config.rateLimiting) {
const { default: useMeshRateLimit } = await import(
'@graphql-mesh/plugin-rate-limit'
);
const { default: useMeshRateLimit } =
await import('@graphql-mesh/plugin-rate-limit');
plugins.push(
useMeshRateLimit({
config: Array.isArray(config.rateLimiting)
Expand All @@ -156,9 +153,8 @@ export async function getBuiltinPluginsFromConfig(
}

if (config.maxTokens) {
const { maxTokensPlugin: useMaxTokens } = await import(
'@escape.tech/graphql-armor-max-tokens'
);
const { maxTokensPlugin: useMaxTokens } =
await import('@escape.tech/graphql-armor-max-tokens');
const maxTokensPlugin = useMaxTokens({
n: typeof config.maxTokens === 'number' ? config.maxTokens : 1000,
});
Expand All @@ -169,9 +165,8 @@ export async function getBuiltinPluginsFromConfig(
}

if (config.maxDepth) {
const { maxDepthPlugin: useMaxDepth } = await import(
'@escape.tech/graphql-armor-max-depth'
);
const { maxDepthPlugin: useMaxDepth } =
await import('@escape.tech/graphql-armor-max-depth');
const maxDepthPlugin = useMaxDepth({
n: typeof config.maxDepth === 'number' ? config.maxDepth : 6,
});
Expand Down Expand Up @@ -209,9 +204,8 @@ export async function getCacheInstanceFromConfig(
if (config.cache && 'type' in config.cache) {
switch (config.cache.type) {
case 'redis': {
const { default: RedisCache } = await import(
'@graphql-mesh/cache-redis'
);
const { default: RedisCache } =
await import('@graphql-mesh/cache-redis');
return new RedisCache({
...ctx,
...config.cache,
Expand All @@ -220,18 +214,16 @@ export async function getCacheInstanceFromConfig(
}) as KeyValueCache;
}
case 'cfw-kv': {
const { default: CloudflareKVCacheStorage } = await import(
'@graphql-mesh/cache-cfw-kv'
);
const { default: CloudflareKVCacheStorage } =
await import('@graphql-mesh/cache-cfw-kv');
return new CloudflareKVCacheStorage({
...ctx,
...config.cache,
});
}
case 'upstash-redis': {
const { default: UpstashRedisCache } = await import(
'@graphql-mesh/cache-upstash-redis'
);
const { default: UpstashRedisCache } =
await import('@graphql-mesh/cache-upstash-redis');
return new UpstashRedisCache({
...ctx,
...config.cache,
Expand All @@ -244,9 +236,8 @@ export async function getCacheInstanceFromConfig(
config.cache,
);
}
const { default: LocalforageCache } = await import(
'@graphql-mesh/cache-localforage'
);
const { default: LocalforageCache } =
await import('@graphql-mesh/cache-localforage');
return new LocalforageCache({
...ctx,
...config.cache,
Expand All @@ -255,8 +246,7 @@ export async function getCacheInstanceFromConfig(
if (config.cache) {
return config.cache as KeyValueCache;
}
const { default: LocalforageCache } = await import(
'@graphql-mesh/cache-localforage'
);
const { default: LocalforageCache } =
await import('@graphql-mesh/cache-localforage');
return new LocalforageCache(ctx);
}
6 changes: 3 additions & 3 deletions packages/pubsub/src/mem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { fakePromise, type MaybePromise } from '@whatwg-node/promise-helpers';
import { PubSub, PubSubListener, TopicDataMap } from './pubsub';

/** In-memory {@link PubSub} implementation. */
export class MemPubSub<M extends TopicDataMap = TopicDataMap>
implements PubSub<M>
{
export class MemPubSub<
M extends TopicDataMap = TopicDataMap,
> implements PubSub<M> {
#disposed = false;
#subscribers = new Map<
keyof M, // topic
Expand Down
6 changes: 3 additions & 3 deletions packages/pubsub/src/nats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export interface NATSPubSubOptions {
}

/** {@link PubSub Hive PubSub} implementation of the [NATS message broker](https://nats.io/). */
export class NATSPubSub<M extends TopicDataMap = TopicDataMap>
implements PubSub<M>
{
export class NATSPubSub<
M extends TopicDataMap = TopicDataMap,
> implements PubSub<M> {
#disposed = false;
#closeOnDispose: boolean;
#activeSubscribers = new Map<() => Promise<void>, keyof M>();
Expand Down
Loading
Loading