-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Chore]: convert adapters to class syntax #7350
Conversation
Performance Report for 2f223c7 Relationship Analysis
|
Asset Size Report for 2f223c7 IE11 Builds The size of the library EmberData has increased by 617.0 B (199.0 B compressed) which exceeds the failure threshold of 15 bytes.WarningsThe uncompressed size of the package @ember-data/adapter has increased by 617.0 B. Changeset
Full Asset Analysis (IE11)
Modern Builds The size of the library EmberData has increased by 617.0 B (199.0 B compressed) which exceeds the failure threshold of 15 bytes.WarningsThe uncompressed size of the package @ember-data/adapter has increased by 617.0 B. Changeset
Full Asset Analysis (Modern)
Modern Builds (No Rollup) The size of the library EmberData has increased by 617.0 B (198.0 B compressed) which exceeds the failure threshold of 15 bytes.WarningsThe uncompressed size of the package @ember-data/adapter has increased by 617.0 B. Changeset
Full Asset Analysis (Modern)
|
packages/adapter/addon/index.ts
Outdated
@@ -321,7 +316,6 @@ export default EmberObject.extend({ | |||
@param {Snapshot} snapshot | |||
@return {Promise} promise | |||
*/ | |||
createRecord: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because this should be typed as a function. Looking at moving these to ts
in this PR or another.
packages/adapter/addon/index.ts
Outdated
@@ -55,7 +55,7 @@ import EmberObject from '@ember/object'; | |||
@class Adapter | |||
@extends EmberObject | |||
*/ | |||
export default EmberObject.extend({ | |||
export default class Adapter extends EmberObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it have to extend EmberObject now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet imagine for many users, this would be an unnoticeable change. However, technically this would be a breaking change.
@snewcomer discussed this in the weekly meeting, will split into a class refactor and a TS refactor. |
f711f7c
to
2f223c7
Compare
@@ -321,7 +316,6 @@ export default EmberObject.extend({ | |||
@param {Snapshot} snapshot | |||
@return {Promise} promise | |||
*/ | |||
createRecord: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to remove these because this will take precedence over prototypal methods defined on our own adapters that extend this class or user defined ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if we should replace these with a function + assert or if we would be better served in the ts migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure what you mean by
We have to remove these because this will take precedence over prototypal methods defined on our own adapters that extend this class or user defined ones.
Can you please explain more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS playground example.
Outstanding question - should I convert to
ts
before merging?