Skip to content

Namespace helper methods for javascript:build tasks #172

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

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

excid3
Copy link
Contributor

@excid3 excid3 commented Sep 13, 2023

Methods defined in Rake files are added to the global namespace. This means cssbundling-rails and jsbundling-rails using the same build_command method name get overridden by one or the other.

This introduces a module to namespace these methods and provides a place for any future methods to be defined.

Since these only apply to the tasks in build.rake, I just defined the module there, but we could extract it to a file and require it instead.

See also rails/cssbundling-rails#132 rails/cssbundling-rails#131

cc @terracatta

@terracatta
Copy link
Contributor

Thanks @excid3 TIL that methods defined here are in a shared namespace with all other rake tasks. I've updated my open PRs as well. hotwired/turbo-rails#494 and hotwired/stimulus-rails#125.

cc/ @dhh & @rafaelfranca.

@rafaelfranca
Copy link
Member

I wish those libraries were just one. They keep influencing each other. Maybe one day...

@rafaelfranca rafaelfranca merged commit ccd3017 into rails:main Sep 13, 2023
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.

3 participants