-
Notifications
You must be signed in to change notification settings - Fork 144
Remove use of deprecated @wordpress/date getSettings() #1039
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT, although it would be nice to remove the dependency altogether considering __experimentalGetSettings().l10n
is our only usage.
I suppose it depends on Gutenberg's ultimate plans for __experimentalGetSettings
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good for this, and is testing well in the browser.
However, it looks like two tests are failing. Looks like maybe something needs to be defined in the test setup?
TypeError: Cannot read property 'userLocale' of undefined.
Error: No locale meta information provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a line to the date/CHANGELOG.md
with a note about this fix?
client/devdocs/example.js
Outdated
@@ -59,7 +59,7 @@ class Example extends Component { | |||
...pkgComponents, | |||
Component, | |||
withState, | |||
getSettings, | |||
getSettings: __experimentalGetSettings, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this, since you're not using getSettings in the component anymore.
979800e
to
f49c94c
Compare
This is happening on console.error node_modules/memize/index.js:74
Jed localization error: Error: No locale meta information provided. |
Several code changes after approval.
Thanks @ryelle @justinshreve! This is ready for another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing well for me.
…instead of using experimental retrieval from @wordpress/date.
84f135d
to
dcb4a00
Compare
Fixes #807.
See: WordPress/gutenberg#10636
Detailed test instructions:
wp.date
deprecation warning is present