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

Remove extraneous requires #336

Merged
merged 4 commits into from
Mar 22, 2023
Merged

Remove extraneous requires #336

merged 4 commits into from
Mar 22, 2023

Conversation

gmcgibbon
Copy link
Member

@gmcgibbon gmcgibbon commented Mar 15, 2023

What are you trying to accomplish?

Closes #335

Remove extraneous requires from the main require file, and clean up early autoloads.

What approach did you choose and why?

Lazily load checkers, validators, and offense formatters so that we don't need to add requires for them in the main file. I also moved the nested autoloads into nested files to make sure they don't load early.

What should reviewers focus on?

This should make sure load times for Packwerk are minimal if the user chooses to add the gem without require: false.

Type of Change

  • Bugfix
  • New feature
  • Non-breaking change (a change that doesn't alter functionality - i.e., code refactor, configs, etc.)

Additional Release Notes

  • Breaking change (fix or feature that would cause existing functionality to change)

Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.

If no additional notes are necessary, delete this section or leave it unchanged.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • It is safe to rollback this change.

We want to stop requiring pieces of Packwerk upfront to prevent cases
like #333. This also adds autoload entries for DefaultOffensesFormatter
and DependencyValidator if the defaults aren't already loaded (and
removes an entry for PrivacyChecker, since it has been extracted).
We move nested autoloads for some files because they trigger autoloads
early, which we don't want.
@gmcgibbon gmcgibbon requested a review from a team as a code owner March 15, 2023 05:38
@gmcgibbon gmcgibbon force-pushed the remove_extraneous_requires branch 2 times, most recently from daa8353 to 16c91cc Compare March 17, 2023 20:13
@gmcgibbon gmcgibbon merged commit 4e02bf1 into main Mar 22, 2023
@gmcgibbon gmcgibbon deleted the remove_extraneous_requires branch March 22, 2023 03:11
@shopify-shipit shopify-shipit bot temporarily deployed to rubygems August 8, 2023 20:48 Inactive
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.

[Bug Report] Default require behaviour
4 participants