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

Use load hooks for monkey_patch loading #48

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

kaspth
Copy link
Contributor

@kaspth kaspth commented Jul 29, 2022

ActiveSupport.on_load(:action_view) is technically how we're supposed
to extend ActionView::Base and other Action View classes, but we weren't
doing that for our monkey patches.

We could add a ActiveSupport.on_load(:action_view) load hook for each
extension, but it feels cleaner to let the top level file handle that
set up.

This then also moves the helper require to the same place for parity.

`ActiveSupport.on_load(:action_view)` is technically how we're supposed
to extend ActionView::Base and other Action View classes, but we weren't
doing that for our monkey patches.

We could add a `ActiveSupport.on_load(:action_view)` load hook for each
extension, but it feels cleaner to let the top level file handle that
set up.

This then also moves the helper require to the same place for parity.
@andrewculver andrewculver merged commit 9179511 into main Jul 29, 2022
@kaspth kaspth deleted the use-load-hooks-for-monkey-patch-loading branch July 29, 2022 13:31
kaspth added a commit that referenced this pull request Sep 6, 2022
* main:
  Ignore /tmp if you're running BT in tmp/starter like CI does
  Fix some CHANGELOG issues and refit some examples + words
  Skip needless CI steps (#60)
  We don't need to depend on sqlite3 that was for an earlier version of the ViewComponent integration
  Fix #54 to use new section yield syntax
  Mixing `yield` call styles (#54)
  Expose Sections as an alternative to `content_for` (#57)
  Introduce Capybara to the test suite (#55)
  Add `content_from` to let partials relay contents (#53)
  v0.1.9
  v0.1.8
  Document release 🎉 (#52)
  Rename `Partial#output_buffer` to `Partial#yield` (#41)
  Allow outer partial access when capturing (#49)
  Fix accessing `partial` before rendering leaks state (#47)
  Use load hooks for monkey_patch loading (#48)
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

Successfully merging this pull request may close these issues.

None yet

2 participants