github / view_component Public
main
Commits on May 11, 2022
-
Add render_parent helper method to avoid double-rendering hijinks (#1353
) * Add render_parent helper method to avoid double-rendering madness * Add CHANGELOG entry * Update docs/CHANGELOG.md Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update docs/guide/templates.md Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update docs/guide/templates.md Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update docs/guide/templates.md Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update lib/view_component/base.rb Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update lib/view_component/base.rb Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update lib/view_component/base.rb Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update lib/view_component/base.rb Co-authored-by: Joel Hawksley <joel@hawksley.org> * Update lib/view_component/base.rb Co-authored-by: Joel Hawksley <joel@hawksley.org> Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
-
-
-
Raise when ViewComponent causes a warning (#1352)
* Raise when ViewComponent causes a warning This adds support for a new env variable, `RAISE_ON_WARNING` which when set to true causes warnings emitted in the test environment to raise an exception. This also enables RAISE_ON_WARNING in CI. * Fix warning raised in slotable_v2 module This removes a call to `ruby2_keywords` that emits a warning. * Fix warning due to uninitialized global buffer * Support vendor path * Fix failure now that the test fails properly * Add changelog entry * Update docs/CHANGELOG.md * Update docs/CHANGELOG.md Co-authored-by: Joel Hawksley <joel@hawksley.org>
Commits on May 10, 2022
Commits on May 9, 2022
Commits on May 4, 2022
-
Separate slot setter and getter method (#1184)
* Separate slot setter and getter method This introduces an explicit setter for slots in the form of `with_#{slot_name}`. This makes it more clear when slots are being set vs accessed but also allows chaining when slots have no arguments. Before this change, the following would not work: ```ruby component.header.with_content("my header!") ``` This fails due to `header` being passed no arguments and no block, resulting in it acting as a getter, returning `nil` since the slot was not defined. This is due to assuming that slots will always be passed either a block or arguments and predates the `with_content` method. Now, the above can be implemented using `with_*`: ```ruby component.with_header.with_content("my header!") ``` * Fix linter, add changelog entry * Update lib/view_component/slotable_v2.rb Co-authored-by: Hans Lemuet <Spone@users.noreply.github.com> * Update lib/view_component/slotable_v2.rb * Update docs/CHANGELOG.md * Update docs, support polymorphic slots, add tests * Fix ruby2_keywords call Co-authored-by: Hans Lemuet <Spone@users.noreply.github.com> Co-authored-by: Joel Hawksley <joel@hawksley.org> -
Move preview controller logic into concern (#1269)
* Move preview controller logic into concern * Update docs/CHANGELOG.md Co-authored-by: Joel Hawksley <joelhawksley@github.com> Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
Add QuickNode as a company using ViewComponent (#1346)
* Added QuickNode to the 'Who uses ViewComponent?' section * Updated changelog
Commits on Apr 23, 2022
-
Move the
Translatablemodule intoBase(#1268)* Move the `Translatable` module out of experimental mode * Use a dedicated callback method for translations Avoid _after_compile as it relies on inheritance and is at risk of being brittle. * Update docs/CHANGELOG.md * Update docs/guide/translations.md * Update docs/guide/translations.md Co-authored-by: Joel Hawksley <joel@hawksley.org>
Commits on Apr 22, 2022
Commits on Apr 21, 2022
Commits on Apr 20, 2022
-
update docs dependencies (#1337)
* update docs dependencies * fix docs typo
-
-
-
Relative translation scopes (#1335)
* Remove unnecessary require * Add support for relative I18n scopes * Update test/view_component/translatable_test.rb * Update lib/view_component/translatable.rb Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
Update CI config to latest Rails 7.0 version (#1271)
* Update CI config to latest Rails 7.0 version * Add Changelog entry * Fix Gemfile.lock to stick with Rails 7.0 * use 7.0.0 in local dev, not main * bad merge Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
Document how to use blocks with lambda slots (#1318)
* Document how to use blocks with lambda slots * Update CHANGELOG * Add self to contributors list * Remove trailing whitespace * Wording tweaks from code review Co-authored-by: Joel Hawksley <joel@hawksley.org> * Pass block to content_tag differently Co-authored-by: Joel Hawksley <joel@hawksley.org> * Add test for providing lambda slot content via block #1318 (review) * Update doc test to match altered sample code Co-authored-by: Joel Hawksley <joel@hawksley.org> * Fix linter violation * Apply suggestions from code review Co-authored-by: Cameron Dutro <camertron@gmail.com> Co-authored-by: Joel Hawksley <joel@hawksley.org>
Commits on Apr 14, 2022
-
Fix bug where Appraisal ran incompatible combination of Ruby and Rails (
#1333) Appraisal does not set the Ruby version, allowing developers to run our tests with incompatible combinations of Ruby and Rails. This change opts Rails 5.2 out of Ruby >=3.0. Closes #1326. Co-authored-by: Blake Williams <blakewilliams@github.com> Co-authored-by: Cameron Dutro <camertron@github.com> Co-authored-by: Blake Williams <blakewilliams@github.com> Co-authored-by: Cameron Dutro <camertron@github.com>
-
Add explainer blurb to the top of the CHANGELOG (#1332)
* Add explainer blurb to the top of the CHANGELOG * Update docs/CHANGELOG.md Co-authored-by: Joel Hawksley <joel@hawksley.org> * Apply suggestions from code review * Update docs/CHANGELOG.md Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
Incorporate Jason's docs (#1331)
* Add "why" explanation to landing page. * Add self to contributor list, add changelog entry. * Reconcile old "why" with new "why". * Change section order on landing page. * Remove version number heading. * Fix heading hierarchy. * condense cohesion docs for landing page * tighten copy * fix heading levels, add TLDR * fix spacing * Apply suggestions from code review Co-authored-by: Jason Swett <jason@mhcare.com> Co-authored-by: Hans Lemuet <Spone@users.noreply.github.com>
-
Add Bearer.com to companies that <3 ViewComponent (#1325)
* Add Bearer.com to companies that <3 ViewComponent We also write a bit about our experience with ViewComponent https://www.bearer.com/blog/snapshot-testing-viewcomponents-with-rspec :) * update components count * alphabetical order * add changelog entry * Update docs/CHANGELOG.md Co-authored-by: Joel Hawksley <joelhawksley@github.com> Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
Commits on Apr 12, 2022
-
Bump nokogiri from 1.13.3 to 1.13.4 (#1329)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](sparklemotion/nokogiri@v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
Bump nokogiri from 1.13.3 to 1.13.4 in /docs (#1330)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](sparklemotion/nokogiri@v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Commits on Mar 31, 2022
Commits on Mar 28, 2022
Commits on Mar 25, 2022
-
-
-
-
-
Fix fragment caching in partials when global output buffer is enabled (…
…#1316) * Fix fragment caching in partials when global output buffer is enabled * Add coverage for both branches of output_buffer= Co-authored-by: Joel Hawksley <joel@hawksley.org>
-
Fix inheritance when lazy loading (#1317)
* Make inheritance work when lazy loading * Add changelog entry