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

Extract Rendering Logic from BaseHelpers #432

Open
1 task done
lessthanjacob opened this issue Jun 25, 2024 · 2 comments · May be fixed by #476
Open
1 task done

Extract Rendering Logic from BaseHelpers #432

lessthanjacob opened this issue Jun 25, 2024 · 2 comments · May be fixed by #476
Assignees

Comments

@lessthanjacob
Copy link
Contributor

lessthanjacob commented Jun 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe

No

Describe the feature you'd like to see implemented

Currently, rendering logic is split between a BaseHelpers module (primarily), and Blueprinter::Base (with the former also being included in the latter). I believe this was done to help "slim down" Blueprinter::Base, but BaseHelpers has seemingly turned into a sort of "junk drawer" of methods.

Since rendering is a clearly defined concept in the context of Blueprint, it would be helpful to encapsulate relevant logic in a specific class (e.g. Renderer), which would help with comprehensibility, testability, and extensibility moving forward.

Describe alternatives you've considered

No response

Additional context

At the moment, the rendering flow looks something like so:

sequenceDiagram
actor User as User
participant B as Blueprinter
participant BH as BaseHelper
participant E as Blueprinter.configuration.extensions

User ->> B: .render(Object)
B ->> BH: .prepare_for_render
BH ->> BH: .validate_root_and_meta
BH ->> B: .prepare
B ->> E: .pre_render
E ->> B: Object
B ->> BH: .prepare_data
BH ->> B: Hash | Array
B ->> BH: .prepend_root_and_meta
BH ->> B: Hash | Array
B ->> B: .jsonify
B ->> User: JSON Object
Loading
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 Sep 1, 2024
@lessthanjacob lessthanjacob reopened this Sep 2, 2024
Copy link

github-actions bot commented Nov 2, 2024

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 10, 2024
@lessthanjacob lessthanjacob reopened this Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant