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

ENH Remove code that had been retained for backwards compatibility #1883

Merged

Conversation

GuySartorelli
Copy link
Member

We don't need to retain this compatibility anymore. Some of this is dead code, and some is just tech debt that should have been properly deprecated.

Issue

@GuySartorelli GuySartorelli marked this pull request as draft January 9, 2025 01:09
Comment on lines -105 to -111
// pass in a single icon (retain backwards compatibility)
icon: PropTypes.shape({
nodeName: PropTypes.string,
className: PropTypes.string,
onClick: PropTypes.func,
action: (props) => { if (props.action) { throw new Error('action: no longer used'); } },
}),
Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't used anywhere that I can find - and if anyone's using it for their own uses they can just pass it as an array to the icons prop instead.

Comment on lines -610 to -618
// these two functions retained for backwards compatibility
showList: function(instant) {
this.showGroupsList(instant);
this.showMembersList(instant);
},
hideList: function(instant) {
this.hideGroupsList(instant);
this.hideMembersList(instant);
},
Copy link
Member Author

Choose a reason for hiding this comment

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

These were only kept in case someone was calling them directly in their own code. See #1531 (review)
Now that we're doing a major release, we can remove these unnecessary functions.

//
// Example: protected function updateUsage(ArrayList &$usage, DataObject &$record)
// $dataObjects = $usage->exclude('ClassName', MyDataObject::class);
$this->extend('updateUsage', $usage, $record);
Copy link
Member Author

Choose a reason for hiding this comment

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

Not used in any core or supported modules

Comment on lines -2300 to -2322
/* src/jquery.entwine.legacy.js */

(function($) {

// Adds back concrete methods for backwards compatibility
$.concrete = $.entwine;
$.fn.concrete = $.fn.entwine;
$.fn.concreteData = $.fn.entwineData;

// Use addHandler to hack in the namespace.$.concrete equivilent to the namespace.$.entwine namespace-injection
$.entwine.Namespace.addHandler({
order: 100,
on: function(selector, k, v) { return false; },

namespaceMethodOverrides: function(namespace){
namespace.$.concrete = namespace.$.entwine;
namespace.injectee.concrete = namespace.injectee.entwine;
namespace.injectee.concreteData = namespace.injectee.entwineData;
return {};
}
});

})(jQuery);
Copy link
Member Author

Choose a reason for hiding this comment

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

concrete was a very very very very very old way of invoking entwine. There's virtually 0 chance anyone is using it.

@GuySartorelli
Copy link
Member Author

I don't think anything here needs to be mentioned in the changelog but happy to add if someone disagrees.

@GuySartorelli GuySartorelli marked this pull request as ready for review January 9, 2025 01:16
@emteknetnz emteknetnz merged commit 31c69c7 into silverstripe:3.0 Jan 9, 2025
17 checks passed
@emteknetnz emteknetnz deleted the pulls/3.0/remove-bc branch January 9, 2025 22:49
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.

2 participants