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

Use multi_json for rendering #442

Open
1 task done
jhollinger opened this issue Jul 15, 2024 · 3 comments
Open
1 task done

Use multi_json for rendering #442

jhollinger opened this issue Jul 15, 2024 · 3 comments
Assignees
Labels
good first issue Good for newcomers on-hold

Comments

@jhollinger
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe

Config option overload.

Describe the feature you'd like to see implemented

multi_json is a popular gem (that we'd need to depend on) for automatically choosing the fastest JSON renderer your application or library has available:

MultiJson.dump({:abc => 'def'})

I've used other serializers, like grape-entity, that support it, as well as many applications. This would simplify configuration by moving it up a layer outside of our library. We could still offer an override for rare cases if we want, maybe via an extension hook.

Describe alternatives you've considered

No response

Additional context

No response

@lessthanjacob lessthanjacob added the good first issue Good for newcomers label Jul 23, 2024
@lessthanjacob lessthanjacob self-assigned this Sep 17, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2024
@lessthanjacob lessthanjacob reopened this Feb 18, 2025
@ritikesh
Copy link
Collaborator

IMO, the library shouldn't have a favourite. Extensions should be the way to go ahead for people wanting that extra performance. For majority of the users, the native JSON lib should suffice.

@jhollinger
Copy link
Contributor Author

jhollinger commented Feb 18, 2025

This is now implemented in #479 with the option to override via an extension hook.

Edit:

If we dislike the idea of adding a dependency, we could change the above so that the multi_json behavior is available as a built-in, optional V2 extension. That way the application is responsible for handling that dependency.

class ApplicationBlueprint < Blueprinter::V2::Base
  extensions << Blueprinter::Extensions::MultiJson.new
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers on-hold
Projects
None yet
Development

No branches or pull requests

3 participants