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

Required adapter/serializer methods should be marked as abstract? #1297

Open
1 of 21 tasks
chancancode opened this issue Sep 1, 2020 · 1 comment
Open
1 of 21 tasks
Labels
types:core:data Something is wrong with the Ember Data type definitions types:core Something is wrong with the Ember type definitions

Comments

@chancancode
Copy link

Which package(s) does this problem pertain to?

  • @types/ember
  • @types/ember__string
  • @types/ember__polyfills
  • @types/ember__object
  • @types/ember__utils
  • @types/ember__array
  • @types/ember__engine
  • @types/ember__debug
  • @types/ember__runloop
  • @types/ember__error
  • @types/ember__controller
  • @types/ember__component
  • @types/ember__routing
  • @types/ember__application
  • @types/ember__test
  • @types/ember__test-helpers
  • @types/ember__service
  • @types/ember-data
  • @types/rsvp
  • Other
  • I don't know
@jamescdavis jamescdavis added the types:core Something is wrong with the Ember type definitions label Sep 3, 2020
@runspired
Copy link

This is complicated because there are two competing things here:

  • the interface that adapters/serializers must conform to, specified here and here
  • the optional base adapter/serializer that is a legacy remnant of when typescript didn't exist and attempted to serve as an abstract class (which you pretty much should NEVER extend but folks do), located here and here

I understand that @types/ember-data tries to type the whole surface, and so these legacy remnants need typed (and probably should be typed as abstract), but a better solution would be to expose the interfaces.

The existing RFC for types support in the ember ecosystem will eventually lead to this being the case, but I'd propose that until then fake imports be provided from where these things live in the docs. Specifically:

import { MinimumAdapterInterface } from '@ember-data/adapter';
import { MinimumSerializerInterface } from '@ember-data/serializer';

@chriskrycho chriskrycho added the types:core:data Something is wrong with the Ember Data type definitions label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types:core:data Something is wrong with the Ember Data type definitions types:core Something is wrong with the Ember type definitions
Projects
None yet
Development

No branches or pull requests

4 participants