Skip to content

Commit 4199293

Browse files
authored
Deprecate use_helper(s) in favor of include MyHelper or helpers. (#2331)
1 parent 8ecd4dd commit 4199293

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 6
1010

1111
## main
1212

13+
* Deprecate `use_helper(s)`. Use `include MyHelper` or `helpers.` proxy instead.
14+
15+
*Joel Hawksley*
16+
1317
* Reduce string allocations during compilation.
1418

1519
*Jonathan del Strother*

lib/view_component/use_helpers.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ def use_helpers(*args, from: nil, prefix: false)
99
end
1010

1111
def use_helper(helper_method, from: nil, prefix: false)
12+
ViewComponent::Deprecation.deprecation_warning(
13+
"use_helper(s)",
14+
"Use `include MyHelper` or `helpers.` proxy instead."
15+
)
16+
1217
helper_method_name = full_helper_method_name(helper_method, prefix: prefix, source: from)
1318

1419
class_eval(<<-RUBY, __FILE__, __LINE__ + 1)

0 commit comments

Comments
 (0)