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

No Implicit Any #639

Merged
merged 4 commits into from Aug 5, 2021
Merged

No Implicit Any #639

merged 4 commits into from Aug 5, 2021

Conversation

evantahler
Copy link
Member

No description provided.

@evantahler evantahler merged commit 2744a83 into main Aug 5, 2021
@evantahler evantahler deleted the no-implict-any branch August 5, 2021 01:52
@CvX
Copy link
Contributor

CvX commented Nov 20, 2021

This ship has already sailed in terms of a major version bump, but this was a breaking change. 😃
It makes it so that Job objects require plugin and pluginOptions properties:

error TS2739: Type '{ perform: (id: number) => Promise<void>; }' is missing the following properties from type 'Job<any>': plugins, pluginOptions

So this:

let worker = new Worker({ connection, queues: ["stuff"] }, {
  publish: { perform },
});

is no longer valid, and has to be changed (unnecessarily, imo) to:

let worker = new Worker({ connection, queues: ["stuff"] }, {
  publish: { perform, plugins: [], pluginOptions: {} },
});

@evantahler
Copy link
Member Author

evantahler commented Nov 20, 2021

We could certainly make those types on Job optional! Are you able to open a PR with the type change?

I think the change would only be here

export interface Job<TResult> {
plugins: Array<any>;
pluginOptions: {
[pluginName: string]: {
[key: string]: any;
};
};
perform: (...args: any[]) => Promise<TResult>;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants