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

standardize and improve resource and adapter modules #667

Merged
merged 25 commits into from
Jan 24, 2025

Conversation

pehbehbeh
Copy link
Member

@pehbehbeh pehbehbeh commented Nov 14, 2024

  • standardize functions in Backpex.Resource (parameters and result tuples)
  • standardize functions in Backpex.Adapter (parameters incl. typespecs)
  • implement bang function (only get!/1 for now) in Backpex.Resource instead of specific adapters
  • simplify stuff by reducing parameters

lib/backpex/exceptions.ex Show resolved Hide resolved
lib/backpex/resource.ex Show resolved Hide resolved
@pehbehbeh pehbehbeh changed the title remove adapter specific bang function standardize and improve resource and adapter modules Jan 17, 2025
@pehbehbeh pehbehbeh marked this pull request as ready for review January 17, 2025 13:59
@pehbehbeh pehbehbeh requested a review from Flo0807 January 17, 2025 13:59
@pehbehbeh pehbehbeh added the enhancement Changes that are not breaking label Jan 17, 2025
@pehbehbeh pehbehbeh self-assigned this Jan 17, 2025
@@ -328,9 +319,6 @@ defmodule Backpex.LiveResource do
@impl Backpex.LiveResource
def search_placeholder, do: Backpex.translate("Search")

@impl Backpex.LiveResource
def item_query(query, _live_action, _assigns), do: query
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will no longer add fallback (cover all) item_query/3 functions to your LiveResources. I added a hint to the v0.11 upgrade guide that you have to cover all cases with item_query/3. We had this error in our demo, too. The User edit, show and new view crashed because of this.

@Flo0807 Flo0807 merged commit b89cb87 into develop Jan 24, 2025
6 checks passed
@Flo0807 Flo0807 deleted the feature/adapter-bang branch January 24, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Changes that are not breaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants