Add deprecation warning for convertPreferences() #11174

Merged
merged 1 commit into from Jun 20, 2015

Projects

None yet

6 participants

@le717
Contributor
le717 commented May 27, 2015

For #10412.

@nethip Any suggestions for the message wording?

@nethip nethip commented on the diff Jun 8, 2015
src/preferences/PreferencesManager.js
@@ -528,7 +532,7 @@ define(function (require, exports, module) {
* @return {boolean} true if a value was set
*/
function setValueAndSave(id, value, options) {
- DeprecationWarning.deprecationWarning("setValueAndSave called for " + id + ". Use set instead.");
@nethip
nethip Jun 8, 2015 Contributor

@le717 Wording looks OK to me. Should we make use of the second param, oncePerCaller, for deprecationWarning.

@le717
le717 Jun 12, 2015 Contributor

Sure thing.

@le717
Contributor
le717 commented Jun 12, 2015

@nethip Suggested change made, ready to go.

@MarcelGerber MarcelGerber and 1 other commented on an outdated diff Jun 13, 2015
src/preferences/PreferencesManager.js
@@ -528,7 +532,7 @@ define(function (require, exports, module) {
* @return {boolean} true if a value was set
*/
function setValueAndSave(id, value, options) {
- DeprecationWarning.deprecationWarning("setValueAndSave called for " + id + ". Use set instead.");
+ DeprecationWarning.deprecationWarning("PreferencesManager.setValueAndSave() called for " + id + ". Use set instead.", true);
@MarcelGerber
MarcelGerber Jun 13, 2015 Member

To be consistent, we should change set to PreferencesManager.set(), too.

Otherwise, this looks good and we definitely want this in Release 1.4.

@le717
le717 Jun 14, 2015 Contributor

Will do.

@MarcelGerber
Member

Could you also add the @deprecated JSDoc to getPreferenceStorage?

@le717
Contributor
le717 commented Jun 14, 2015

@MarcelGerber All changes made.

@rroshan1 rroshan1 and 1 other commented on an outdated diff Jun 15, 2015
src/preferences/PreferencesManager.js
@@ -123,7 +125,7 @@ define(function (require, exports, module) {
// having _doNotCreate set to true, then the caller is using the old preferences model.
if (!_doNotCreate) {
var clientString = typeof clientID === "object" ? clientID.uri : clientID;
- DeprecationWarning.deprecationWarning("getPreferenceStorage is called with client ID '" + clientString + ",' use PreferencesManager.definePreference instead.");
+ DeprecationWarning.deprecationWarning("PreferencesManager.getPreferenceStorage() is called with client ID '" + clientString + ",' use PreferencesManager.definePreference() instead.");
@rroshan1
rroshan1 Jun 15, 2015 Contributor

The closing single quote should come before comma after printing the client string.
Also more importantly, we could have a uniform deprecation message instead of three different on various occasions. I would suggest a simple and uniform:-
"PreferencesManager.<some_deprecated_fn> called with client id <client_id> has been deprecated. Use PreferencesManager.<updated_fn> instead".

@le717
le717 Jun 20, 2015 Contributor

Updated message. Is that better?

@MarcelGerber MarcelGerber added this to the Release 1.4 milestone Jun 15, 2015
@MarcelGerber
Member

The messages are still not quite streamlined, but as it's unlikely, for an end user, to get both at the same time, I'll merge anyway.

@MarcelGerber MarcelGerber merged commit 1a74ece into adobe:master Jun 20, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sprintr
Contributor
sprintr commented Jul 7, 2015

PreferencesManager.convertPreferences is still being used in the core in src/utils/Resizer.js. I think it should be safe to remove it. _isPanelPreferences should be removed as well.

Edit: There are more than one instance where it is being used.

@le717 le717 deleted the le717:issue-10412 branch Jul 16, 2015
@le717
Contributor
le717 commented Jul 16, 2015

@sprintr Apologies for what's probably a dumb question, but how exactly would that be updated? Resizer is a core (but not core extension) module, but I have never seen a panelState key in the preferences file.

@abose abose added the Deprecation label Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment