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 actionview-html-sanitizer #49714

Closed
wants to merge 1 commit into from

Conversation

tongueroo
Copy link

@tongueroo tongueroo commented Oct 20, 2023

Motivation / Background

This Pull Request has been created because allows actionview to be required with defining theRails constant.

Detail

Once the Rails constant is defined, it makes it more challenging to use with frameworks like Jets with actionview because other gems that do this:

some_gem/railtie.rb

require "some_gem/railtie" if defined?(Rails)

won't be able to be used with Jets. Renaming to actionview-html-sanitizer gives other gems a chance to work with Jets, also.

Note: The ideal way to check would be for the other gems to use this instead:

require "some_gem/railtie" if defined?(Rails::Railtie)

It's a bummer, gems authors are not always aware of this.

Additional information

Related:

Note, there would need to be some sequencing for this to be release.

  1. The renamed actionview-html-sanitizer gem would first need to be release.
  2. Then it would be available for this PR to work.

I tested it by installing the renamed actionview-html-sanitizer gem locally with rake install.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@flavorjones
Copy link
Member

I've commented on the upstream PR, but suffice to say I remain unconvinced that this approach is an appropriate solution, given how many Rails apps are likely to be broken by this renaming without a great deal more effort being put in.

At the very least, this should be closed unless and until the upstream renaming happens (which it likely won't) to focus the conversation there.

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

Successfully merging this pull request may close these issues.

None yet

2 participants