-
-
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
feat: Improve extensibility #9069
Conversation
@@ -52,7 +52,7 @@ type Store = { | |||
// host and namespace which are provided by the final consuming | |||
// class to the prototype which can result in overwrite errors | |||
|
|||
interface BuildURLConfig { | |||
export interface BuildURLConfig { |
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.
@runspired I have a question, do you think it would be useful to allow users to overwrite function that does resourcePath
conversion right here as part of BuildURLConfig?
Something like
BuildURLConfig({
host: "https://myhost.com",
namespace: "api/v1",
resourcePath: (resourceName) => {
return camelize(pluralize(resourceName));
}
});
or is it too crazy and I should go to sleep ?
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.
go to sleep :P
This is mostly already configurable in this way though maybe we could make it even more configurable
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.
Yeah I know you can configure it using builder options, but would be nice to have it in single place like it used to be in adapter. It would cover 90% cases, and you can still change it on builder level
* feat: improve configurability of json-api builder and request-manager * fix types * add tests * fix prettier * fix forgottend debugger * fixup lint * fix lint
* feat: improve configurability of json-api builder and request-manager * fix types * add tests * fix prettier * fix forgottend debugger * fixup lint * fix lint
This PR introduces two small features to improve extension and configuration
ember-data/store
will only create aRequestManager
if one does not exist.@ember-data/json-api/request
now extends and re-exportssetBuildURLConfig
to allow users to specify which json-api extensions and profiles are in use.