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

[FEATURE deprecate-get-with-default] Deprecate getWithDefault #18993

Merged
merged 2 commits into from
May 29, 2020
Merged

[FEATURE deprecate-get-with-default] Deprecate getWithDefault #18993

merged 2 commits into from
May 29, 2020

Conversation

chrisrng
Copy link
Contributor

Based on RFC 0554

Also added:
ember-learn/deprecation-app#600

@elwayman02
Copy link
Contributor

Thank you! It was confusing seeing the docs not show this as deprecated.

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

I think we also need to deprecate this.getWithDefault (I suspect this deprecation does fire in that case, but the docs at least need to be updated):

@method getWithDefault
@param {String} keyName The name of the property to retrieve
@param {Object} defaultValue The value to return if the property value is undefined
@return {Object} The property value or the defaultValue.
@public
*/
getWithDefault(keyName, defaultValue) {
return getWithDefault(this, keyName, defaultValue);
},

packages/@ember/-internals/metal/lib/property_get.ts Outdated Show resolved Hide resolved
…est and computed_test, Add docs for getWithDefault in observable
@chrisrng
Copy link
Contributor Author

I think we also need to deprecate this.getWithDefault (I suspect this deprecation does fire in that case, but the docs at least need to be updated):

@method getWithDefault
@param {String} keyName The name of the property to retrieve
@param {Object} defaultValue The value to return if the property value is undefined
@return {Object} The property value or the defaultValue.
@public
*/
getWithDefault(keyName, defaultValue) {
return getWithDefault(this, keyName, defaultValue);
},

Ah yeah added the doc here!

@@ -194,6 +194,7 @@ export function getWithDefault<T extends object, K extends Extract<keyof T, stri
{
id: 'ember-metal.get-with-default',
until: '4.0.0',
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-metal-get-with-default',
Copy link
Member

Choose a reason for hiding this comment

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

The link doesn't work just yet, do we expect it to be live already?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see, I just merged ember-learn/deprecation-app#600. Once that is published and we can validate the URL is working as expected this should good to go...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works now! :)

@rwjblue rwjblue merged commit 4e8863e into emberjs:master May 29, 2020
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.

3 participants