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

fix(types): update installExtraPlugins to support Promise return type #1681

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

davidglezz
Copy link
Contributor

@davidglezz davidglezz commented Dec 18, 2024

Pull request template

Describe the purpose of the change, the specific changes done in detail, and the issue you have fixed.

Motivation and context

Allow installExtraPlugins to return a Promise in the type.
The implementation/usage already allows it

protected installExtraPlugins(bus: XBus<XEventsTypes, WireMetadata>): Promise<void> {
return Promise.resolve(
this.options.installExtraPlugins?.({ app: this.app, snippet: this.snippetConfig!, bus })
);
}

  • Dependencies. If any, specify:
  • Open issue. If applicable, link:

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to not work as expected)
  • Change requires a documentation update

What is the destination branch of this PR?

  • Main
  • Other. Specify:

How has this been tested?

Tests performed according to testing guidelines:

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review on my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@davidglezz davidglezz requested a review from a team as a code owner December 18, 2024 17:16
Copy link
Contributor

@victorcg88 victorcg88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should now add to the doc a brief explanation about the return

@victorcg88 victorcg88 self-requested a review December 19, 2024 11:10
@davidglezz
Copy link
Contributor Author

davidglezz commented Dec 19, 2024

Thanks for your review.
Since the awaited return type is void, the type annotation says everything we need to know (IMO), the change is, from sync function to sync or async function that do not return values (void).

@davidglezz davidglezz merged commit 4c7bd97 into main Dec 19, 2024
4 checks passed
@davidglezz davidglezz deleted the improve-InstallXOptions-installExtraPlugins-type branch December 19, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants