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

Possible to use ViewComponent? #206

Open
dentarg opened this issue Dec 28, 2020 · 1 comment
Open

Possible to use ViewComponent? #206

dentarg opened this issue Dec 28, 2020 · 1 comment
Labels

Comments

@dentarg
Copy link
Member

dentarg commented Dec 28, 2020

I like the gist of this, from https://viewcomponent.org/#why-should-i-use-components

Unlike traditional Rails views, ViewComponents can be unit-tested. In the GitHub codebase, component unit tests take around 25 milliseconds each, compared to about six seconds for controller tests.

Rails views are typically tested with slow integration tests that also exercise the routing and controller layers in addition to the view. This cost often discourages thorough test coverage.

With ViewComponent, integration tests can be reserved for end-to-end assertions, with permutations and corner cases covered at the unit level.

More:

@dentarg
Copy link
Member Author

dentarg commented Sep 29, 2022

Or Phlex? phlex-ruby/phlex#86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant