-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Only require the necessary Rails frameworks #3478
Conversation
Hey @elia, this is interesting. A couple of things:
|
596c939
to
59d1f7e
Compare
@kennyadsl I've updated the code to remove the comments and include some specs. There's a remote risk that another spec in the full suite is loading one of the optional Rails frameworks breaking it if it's executed first. The only truly safe alternative would be to always run those specs in isolation, but that seems overkill given it's unlikely that any specs will need to |
59d1f7e
to
3eb6459
Compare
1237e6a
to
7a3d127
Compare
I'm rebasing and updating the PR with @elia's blessing ✋ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elia @filippoliverani thank you 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
What about attempting to run all spec files individually with something like this?
It will take forever ⌛ but I think it could give us some peace of mind. |
@kennyadsl makes sense to me! And I guess you man just locally, not as part of the CI right? (I'll try it and keep you posted on the results) |
@kennyadsl @filippoliverani got just one failure:
Here's the full log https://gist.githubusercontent.com/elia/78da423cb3ca778045d06da773aecdff/raw/a448024083a37b8964b03215e3cdcc8655e99d08/gistfile1.txt |
By requiring rails/all Solidus was loading a bunch of unnecessary code taking more time and consuming more memory. This change allows apps that want to cherry-pick Rails frameworks to benefit from the more attentive choice.
This is due to a missing require in the spec, it only requires: require 'spec_helper' but relies on |
7a3d127
to
ed8b7f9
Compare
Thanks @elia and @filippoliverani! |
Description
By requiring rails/all Solidus was loading a bunch of unnecessary code
taking more time and consuming more memory. This change allows apps
that want to cherry-pick Rails frameworks to benefit from the more
attentive choice.
The list of frameworks I enabled for each component of Solidus comes from searching the subdir (e.g.
core/
) with this regular expression:/\b(Action|Active|Application)[A-Z]/
.Checklist: