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

render_collection #498

Merged
merged 5 commits into from
May 5, 2021
Merged

render_collection #498

merged 5 commits into from
May 5, 2021

Conversation

leastbad
Copy link
Contributor

@leastbad leastbad commented May 3, 2021

Type of PR (feature, enhancement, bug fix, etc.)

Enhancement

Description

Renames the Reflex#wrap method to render_collection.

Render collection method signature now includes a single resource passed, so:

wrap(render(@posts), @posts) now becomes render_collection(@posts)

I created a temporary wrap method that issues a stern deprecation warning, even though technically wrap has never been part of a shipped release. It issues a warning that is hard to ignore and then passes to render_collection. We'll remove this before shipping the final v3.5.

Why should this be added

I strongly suspect that 90% of wrap calls will actually receive the same parameter essentially twice. You can still call it the old way, but if you cut through to general intent, this is clearly a superior name and mechanism.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

@leastbad leastbad added proposal ruby Pull requests that update Ruby code labels May 3, 2021
@leastbad leastbad added this to the 3.5 milestone May 3, 2021
@leastbad leastbad self-assigned this May 3, 2021
@leastbad leastbad requested a review from hopsoft May 3, 2021 23:21
Copy link
Contributor

@hopsoft hopsoft left a comment

Choose a reason for hiding this comment

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

Looks great. I think we should remove wrap and the deprecation warning as its never been released.

@leastbad leastbad merged commit 48336a6 into stimulusreflex:master May 5, 2021
@leastbad leastbad deleted the wrap branch August 16, 2021 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants