-
-
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
Update blueprints to import modules directly #4070
Conversation
2e44a7b
to
2dfbdf6
Compare
FYI, I have an somewhat accompanying PR #4023 open, which would make your adapter test The failing tests should be fixed once a new release for This looks very good to me 👍 ! Nice change importing modules directly! |
- Import JSONAPIAdapter module directly in blueprint - Import JSONAPISerializer module directly in blueprint - Import Transform module directly in blueprint - Import attr module directly in model blueprints when needed - Import belongsTo and hasMany modules directly in blueprints when needed
2dfbdf6
to
bcab3b5
Compare
@pangratz turns out, the tests were failing because of a typo Would you like me to remove the |
No, you can leave it in I guess. This PR will likely be merged soon, so I will update the test in #4023 once this is the case. |
} | ||
|
||
if (shouldImportBelongsTo && shouldImportHasMany) { | ||
importStatements.push('import { belongsTo, hasMany } from \'ember-data/relationships\';'); |
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.
Out of scope for this pr but I've been thinking it may be useful to add a path that allows users to import belongsTo
, hasMany
and attr
all on the same line.
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.
👍
This should wait until #4075 is resolved |
^^ was fixed by #4091 |
Update blueprints to import modules directly
Thanks @HeroicEric |
TL;DR;
This does two things:
DS
I originally added the extra tests to cover the existing behavior before I changed it. If you'd rather have those split out into a separate PR LMK.
Details
JSONAPIAdapter
module directly in blueprintJSONAPISerializer
module directly in blueprintTransform
module directly in blueprintattr
module directly in model blueprints when neededbelongsTo
andhasMany
modules directly in blueprints when needed