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

Prevent unnecessary application reloads in development #50708

Merged

Conversation

aeroastro
Copy link
Contributor

Motivation / Background

As commented in #37011 (comment),
previously, changes in some files outside the autoload paths triggered reloading application.

For instance, editing app/README.md would trigger a reload,
even though the reloaded classes and modules, which were under autoload paths,
were identical to those loaded previously.

Detail

This PR fixes this issue by ensuring the application reloads correctly
according to Rails.autoloaders.main.dirs, thereby preventing unnecessary reloads.

Additional information

I have fixed the issue according to the above comment.

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.

Previously, the Rails application would reload due to changes
in some files outside the autoload paths.
For instance, editing `app/README.md` would trigger a reload,
even though the reloaded classes and modules were identical
to those loaded previously.

This commit fixes this issue by ensuring the application reloads correctly
according to `Rails.autoloaders.main.dirs`, thereby preventing unnecessary reloads.

rails#37011 (comment)
@rails-bot rails-bot bot added the railties label Jan 11, 2024
@rafaelfranca rafaelfranca merged commit 2335328 into rails:main Jan 11, 2024
4 checks passed
@aeroastro aeroastro deleted the feature/watch-directories-instead-of-file branch January 12, 2024 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants