-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Potential name clashes with Avo::TurboStreamActionsHelper #3462
Comments
Hmm. I see what you're saying. |
dark-panda
added a commit
to dark-panda/avo
that referenced
this issue
Nov 27, 2024
@adrianthedev posted a first cut of a PR at #3467. |
dark-panda
added a commit
to dark-panda/avo
that referenced
this issue
Nov 28, 2024
4 tasks
Paul-Bob
pushed a commit
that referenced
this issue
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Avo::TurboStreamActionsHelper defines Turbo Stream helper methods for
#download
,#flash_alerts
, and#close_modal
. These are very common names which can clash with other identically named Turbo Stream helper methods that may be defined by a Rails application or by other libraries. In our case, we have our own Turbo Stream helper called#close_modal
and because we also do aTurbo::Streams::TagBuilder.prepend
on own helpers, the two clash with each other and the Avo one ends up taking precedence as it gets included after ours do. However, because they're both identically named, one of them will inherently fail unless one of these two methods is renamed. I'd suggest renaming these methods to#avo_download
,#avo_flash_alerts
, and#avo_close_modal
to prevent them from clashing with user applications.Steps to Reproduce
Create your own Turbo Stream helpers in a module and prepend them into
Turbo::Streams::TagBuilder
.Expected behavior & Actual behavior
Avo Turbo Stream helpers should not overwrite those found in the main app.
Models and resource files
pp/helpers/avo/turbo_stream_actions_helper.rb
System configuration
Avo version: 3.14.1
Rails version: 8.0.0
Ruby version: 3.3.6
License type:
Are you using Avo monkey patches, overriding views or view components?
None that would impact this particular issue, since the issue is due to prepending identically named methods into
Turbo::Streams::TagBuilder
.Screenshots or screen recordings
N/A
Additional context
N/A
Impact
Urgency
The text was updated successfully, but these errors were encountered: