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 Deprecated code from Backend component #5021

Merged

Conversation

kennyadsl
Copy link
Member

This PR is part of 3.x Deprecations Removal.

Summary

This PR removes all the code deprecated in the Backend component. Please refer to each commit to better understand what has been removed and their replacements.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@kennyadsl kennyadsl added type:enhancement Proposed or newly added feature release:major Breaking change on hold until next major release labels Apr 18, 2023
@kennyadsl kennyadsl requested a review from a team as a code owner April 18, 2023 07:39
@kennyadsl kennyadsl self-assigned this Apr 18, 2023
@github-actions github-actions bot added the changelog:solidus_backend Changes to the solidus_backend gem label Apr 18, 2023
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking comment. 👏 👏 👏

Comment on lines 22 to 23
if (typeof(options['searchParameters']) === 'function') {
return options['searchParameters'](term)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we're not expecting any other type, should we drop the if condition?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RyanofWoods I'd love your opinion here, thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it now makes sense to drop if (typeof(options['searchParameters']) === 'function') @kennyadsl, as if they pass a object, searchParameters should be mandatory. Please update the JSDocs as well -> * @param {Function} options.searchParameters. If they still haven't updated their deprecated code as well, it will be now more useful as it will break rather than silently do default behavior.

Note, this will mean stores cannot explicit pass in a empty object for default behavior, but they should have saw the deprecation for this, and they can just not pass any parameter for this behavior.

Copy link
Contributor

@RyanofWoods RyanofWoods Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more note, this acts a little differently to productPicker, which defaults options to {} immediately, so we need this searchParameters check. Ideally they would have the same structure in the future 🤔
https://github.com/nebulab/solidus/blob/master/backend/app/assets/javascripts/spree/backend/product_picker.js

@kennyadsl kennyadsl marked this pull request as draft April 24, 2023 09:20
@kennyadsl kennyadsl assigned elia and kennyadsl and unassigned kennyadsl Apr 24, 2023
Instead, pass only

    searchParameters: function (_selectSearchTerm) { return { suppliable_only: true  } }

Ref solidusio#4767
Use Spree::LineItem#display_amount instead.

Ref solidusio#4876
@elia elia force-pushed the kennyadsl/remove-deprecated-backend-3.x branch from 0d21f34 to cc17289 Compare April 24, 2023 09:59
@elia elia marked this pull request as ready for review April 24, 2023 10:20
@kennyadsl kennyadsl merged commit 869b73a into solidusio:master Apr 24, 2023
@kennyadsl kennyadsl deleted the kennyadsl/remove-deprecated-backend-3.x branch April 24, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem release:major Breaking change on hold until next major release type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants