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: Remove adapter commons type alternatives #1620

Merged
merged 2 commits into from
Oct 14, 2019
Merged

fix: Remove adapter commons type alternatives #1620

merged 2 commits into from
Oct 14, 2019

Conversation

daffl
Copy link
Member

@daffl daffl commented Oct 14, 2019

Changes back some things from #1567 since it broke type compatibility in existing applications (like the feathers-chat and generated application).

@daffl daffl merged commit c9f3086 into master Oct 14, 2019
@daffl daffl deleted the adapter-types branch October 14, 2019 22:03
@vonagam
Copy link
Member

vonagam commented Oct 16, 2019

That's why i wrote in point 3:

Small breaking change, super easily fixed by removing T | from types of adapters in _find methods.

Were there other problems than this?

@daffl
Copy link
Member Author

daffl commented Oct 16, 2019

Ah, sorry I missed that one, I thought only the other PR was a breaking change. But yes, basically aside from all TS app builds, all database adapter types broke because they were incompatible with this change. I'm planning on adding dtslint so that it should catch things like this hopefully earlier.

@vonagam
Copy link
Member

vonagam commented Oct 16, 2019

Ok, just to clarify and understand.

I understand why this line was reverted to include T as possible return value. Because it is (small) breaking change and to fix it you need to change this line in every adapter:

// from
_find(params?: Params): Promise<T | T[] | Paginated<T>>;
// to
_find(params?: Params): Promise<T[] | Paginated<T>>;

But was there a problem with overloads in AdapterService or were they reverted in bulk with _find?

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