mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
build: bump dependencies (#10457)
* build: bump `@vladfrangu/async_event_emitter` * chore: bump again + fixes * build: bump types/node and some dev deps * build: bump discord-api-types again * style: remove unused eslint-ignore comment * build: sync dependencies and update templates * build: bump turbo * build: vercel + vitest * build: bump undici --------- Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
This commit is contained in:
@@ -27,7 +27,9 @@ export class SimpleShardingStrategy implements IShardingStrategy {
|
||||
for (const shardId of shardIds) {
|
||||
const strategy = new SimpleContextFetchingStrategy(this.manager, strategyOptions);
|
||||
const shard = new WebSocketShard(strategy, shardId);
|
||||
|
||||
for (const event of Object.values(WebSocketShardEvents)) {
|
||||
// @ts-expect-error Ugly casts are needed because when we try to collect all args, TS doesn't handle that nicely due to the strictness + lack of context
|
||||
shard.on(event, (...args) => this.manager.emit(event, ...args, shardId));
|
||||
}
|
||||
|
||||
|
||||
@@ -148,13 +148,14 @@ export class WorkerBootstrapper {
|
||||
for (const shardId of this.data.shardIds) {
|
||||
const shard = new WebSocketShard(new WorkerContextFetchingStrategy(this.data), shardId);
|
||||
for (const event of options.forwardEvents ?? Object.values(WebSocketShardEvents)) {
|
||||
shard.on(event, (...args) => {
|
||||
shard.on(event, (...args: unknown[]) => {
|
||||
const payload: WorkerReceivePayload = {
|
||||
op: WorkerReceivePayloadOp.Event,
|
||||
event,
|
||||
data: args,
|
||||
shardId,
|
||||
};
|
||||
|
||||
parentPort!.postMessage(payload);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
||||
|
||||
private initialHeartbeatTimeoutController: AbortController | null = null;
|
||||
|
||||
private heartbeatInterval: NodeJS.Timer | null = null;
|
||||
private heartbeatInterval: NodeJS.Timeout | null = null;
|
||||
|
||||
private lastHeartbeatAt = -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user