-
-
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
Use Flickwerk for loading patches in solidus_promotions and solidus_legacy_promotions #6049
Open
mamhoff
wants to merge
6
commits into
solidusio:main
Choose a base branch
from
mamhoff:flickwerk-promotions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+251
−223
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
changelog:solidus_core
Changes to the solidus_core gem
changelog:solidus_legacy_promotions
Changes to the solidus_legacy_promotions gem
changelog:solidus_promotions
Changes to the solidus_promotions gem
labels
Dec 21, 2024
adammathys
approved these changes
Jan 3, 2025
mamhoff
force-pushed
the
flickwerk-promotions
branch
2 times, most recently
from
January 3, 2025 17:05
cd8ae9f
to
f8b3503
Compare
tvdeyen
reviewed
Jan 3, 2025
mamhoff
commented
Jan 3, 2025
Waits until #6056 got merged |
mamhoff
force-pushed
the
flickwerk-promotions
branch
from
January 9, 2025 16:37
f8b3503
to
955e210
Compare
tvdeyen
approved these changes
Jan 9, 2025
mamhoff
force-pushed
the
flickwerk-promotions
branch
3 times, most recently
from
January 15, 2025 10:19
d2680fc
to
de7f1c7
Compare
Otherwise, patching it does not work.
When configuring Flickwerk, we need a way to get at class names without constantizing (i.e. loading) those classes. This adds some specs for the `class_name_attribute` class method on Spree::Preferences::Configuration, and generates a new getter that has `_name` attached to the method to get just the string name.
This stops us from loading line item, order, adjustment, shipment, shipping rate, and the order recalculator on app startup.
This should stop us from loading order, line items, adjustment, calculators, the order updater, product, and shipment on app startup.
mamhoff
force-pushed
the
flickwerk-promotions
branch
from
January 15, 2025 11:38
de7f1c7
to
230478e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changelog:solidus_core
Changes to the solidus_core gem
changelog:solidus_legacy_promotions
Changes to the solidus_legacy_promotions gem
changelog:solidus_promotions
Changes to the solidus_promotions gem
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Uses the Flickwerk gem to load patches in the solidus_promotions and solidus_legacy_promotions gems.
This allows us to defer loading of patches to when the classes being patched are autoloaded, rather than loading them in a
config.to_prepare
block.The commit history should explain the few things I had to add here. Namely, I had to add a getter to
Spree::Preferences::Configuration
for the class names of configurable classes in order to configure Flickwerk to be able to understand patches likeSpree::Config.order_recalculator_class.prepend self
.Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: