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

Chore/jsonapi upgrade to 0.9.12 #420

Merged
merged 5 commits into from
Mar 3, 2023
Merged

Conversation

tsubik
Copy link
Collaborator

@tsubik tsubik commented Feb 16, 2023

Upgrading jsonapi resources to newest 0.9 version which has Rails 6.1 support.

Note: I tried both master and 0.10 branch of jsonapi resources and always had different issues. I'm tired of this library, but creating API from scratch using for example jsonapi serializer is a big task at this point.

I tested that with both frontend apps using automated Cypress tests and all looked good. Will push this to staging soon to have it there for a while.

@tsubik tsubik changed the title Chore/jsonapi upgrade 0 9 Chore/jsonapi upgrade to 0.9.12 Feb 16, 2023
@@ -1,9 +1,5 @@
module V1
class BaseResource < JSONAPI::Resource
abstract

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this anymore? It doesn't include the custom links by default?

@@ -7,6 +7,8 @@
config.maximum_page_size = 3000
config.resource_cache = Rails.cache
config.always_include_to_one_linkage_data = false
config.warn_on_missing_routes = false
config.default_exclude_links = :default
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, here is the default_exclude_links that removes links. Although, as this gem is so unstable across different versions it's always better to check if it works ;]

@santostiago
Copy link
Contributor

What issues did you run into when trying to move to 0.10?

@tsubik
Copy link
Collaborator Author

tsubik commented Feb 20, 2023

I don't even want to start talking about it. 0.10 is rewrite of crucial components and in that version or maybe master, don't even remember now, either STI works differently, or stops including nested relations or any relations in included (on master it started including relationships to main objects causing most of frontend to have circular reference errors). I would love to rewrite API in something different and forget about that gem lol or we can wait and see if there are any signs of improvements for that gem (as right now I can say it's almost unmaintained)

@tsubik tsubik merged commit 1128f6c into develop Mar 3, 2023
@tsubik tsubik deleted the chore/jsonapi-upgrade-0-9 branch March 7, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants