Skip to content

Braking change when deprecating ListLogSummary TS type #586

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

Closed
lGSMl opened this issue Feb 23, 2021 · 1 comment · Fixed by #587
Closed

Braking change when deprecating ListLogSummary TS type #586

lGSMl opened this issue Feb 23, 2021 · 1 comment · Fixed by #587
Labels

Comments

@lGSMl
Copy link

lGSMl commented Feb 23, 2021

export interface ListLogSummary<T = DefaultLogFields> {

was left without default type for generic
export type ListLogSummary<T> = LogResult<T>;

Introduced in #533

removing default type for generic results in error for the client using this API, if it was used without specifying concrete type before deprecation

e.g.

 async log(): Promise<ListLogSummary> {
        return this.simpleGit.log();
    }

will return
Generic type 'ListLogSummary' requires 1 type argument(s)

I understand that there is another interface with default type to use now, but it still was unpleasant surprise and not sure why default type could not be preserved while deprecating

steveukx added a commit that referenced this issue Feb 23, 2021
…f the new `LogResult`, the alias type should also support the default generic `DefaultLogFields` to allow downstream consumers to upgrade to newer `2.x` versions without the need to specify a generic.

Closes #586
@steveukx
Copy link
Owner

Hi, thank you for pointing this out - there were no tests left using the deprecated interface which let this one slip through. The new version 2.35.2 on npm now re-introduces support for the ListLogSummary without a generic.

If you have any other problems using the library, please do open a new issue.

@steveukx steveukx added the bug label Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants