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

feat: Improve extensibility #9069

Merged
merged 7 commits into from
Oct 30, 2023
Merged

feat: Improve extensibility #9069

merged 7 commits into from
Oct 30, 2023

Conversation

runspired
Copy link
Contributor

This PR introduces two small features to improve extension and configuration

  1. ember-data/store will only create a RequestManager if one does not exist.
  2. @ember-data/json-api/request now extends and re-exports setBuildURLConfig to allow users to specify which json-api extensions and profiles are in use.

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature labels Oct 29, 2023
@runspired runspired merged commit 9ea4893 into main Oct 30, 2023
20 checks passed
@delete-merged-branch delete-merged-branch bot deleted the improve-extensibility branch October 30, 2023 00:03
@@ -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 {
Copy link
Collaborator

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 ?

Copy link
Contributor Author

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

Copy link
Collaborator

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

@runspired runspired added the 🎯 release PR should be backported to release label Feb 12, 2024
runspired added a commit that referenced this pull request Feb 12, 2024
* feat: improve configurability of json-api builder and request-manager

* fix types

* add tests

* fix prettier

* fix forgottend debugger

* fixup lint

* fix lint
runspired added a commit that referenced this pull request Feb 12, 2024
* feat: improve configurability of json-api builder and request-manager

* fix types

* add tests

* fix prettier

* fix forgottend debugger

* fixup lint

* fix lint
runspired added a commit that referenced this pull request Feb 13, 2024
* feat: implement postQuery builder (#8925)

* feat: Improve extensibility (#9069)

* feat: improve configurability of json-api builder and request-manager

* fix types

* add tests

* fix prettier

* fix forgottend debugger

* fixup lint

* fix lint

* lint fix

* fix types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 canary PR is targeting canary (default) 🎯 release PR should be backported to release 🏷️ feat This PR introduces a new feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants