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

Cells 5: Removal of Cell::Concept #391

Open
apotonick opened this issue Apr 18, 2016 · 10 comments
Open

Cells 5: Removal of Cell::Concept #391

apotonick opened this issue Apr 18, 2016 · 10 comments
Milestone

Comments

@apotonick
Copy link
Member

apotonick commented Apr 18, 2016

Problem

The differentiation between ViewModel and Concept is not only confusing, the latter also implements some conventions that are not in line with the Trailblazer conventions (which is why I originally introduced Concept).

Solution

Per default, pass a constant to cell.

cell(Post::Cell, ..)

The #cell helper can be configured globally (on the ViewModel class level) to constantize and what not. This assumes that applications either use TRB-style concept cells or suffix cells.

ViewModel.constantize_name! # just an example.

This will allow having one helper cell, one base class ViewModel and the view finding implemented using different resolvers.

@apotonick apotonick added this to the v5.0.0 milestone Apr 18, 2016
@thedanielhanke
Copy link

👍 i prefer a more explicit writing anyway. :foo is more magical than Foo::Cell.

@TrevorHinesley
Copy link

@apotonick if I'm starting a new project with Cells in Rails, should I use concept or cell? If I'm reading this right, concept syntax will be gone in V5.

@apotonick
Copy link
Member Author

https://github.com/trailblazer/trailblazer-cells is gonna be the preferred, canonical way. I love it.

@TrevorHinesley
Copy link

Totally, i just mean is the actual concept helper going to be no more, so that cell is used everywhere? Because in trailblazer-cells I can still use either

@apotonick
Copy link
Member Author

In Cells 5, cell and concept will be identical.

@thedanielhanke
Copy link

then why keeping it?

@apotonick
Copy link
Member Author

In Cells 5, it'll be gone! In 4.1, the old-school RailsWayCell style is still supported, but I hate it a lot! 😆 🚀

@thedanielhanke
Copy link

thedanielhanke commented Jul 19, 2016

new major is always a good time to kick out the known devils.
if that hurts, add a convenience-wrapper, but dont bother too much about compatilibity, fame money and bi***es, its still ruby ;)

@yjukaku
Copy link

yjukaku commented Nov 4, 2016

Just wanted to point out, the trailblazer site still references the concept() method, which was a little confusing to me until I saw this issue. 👍

http://trailblazer.to/gems/cells/

@apotonick
Copy link
Member Author

Make sure to only use Trailblazer::Cell, it's the API of the upcoming Cells 5 that drops all the former versions.

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

No branches or pull requests

4 participants