The JavaScript in Yoast SEO has accumulated quite some technical debt. In this issue we can keep track of refactor chores we can do to improve consistency in the JS code base.
[ ] Consistent casing of localized variables. Currently localized variables use both camelCase and snake_case. This should be consistent.
[ ] Use wp.data everywhere. We currently use Redux thunk in some places and wp.data in other places to map state and actions to components. This should only be wp.data (with selectors).
[ ] Remove redux, react-redux and redux-thunk as dependencies.
[x] Stop using localized variables directly in code that has access to the store. Currently, we access localized variables anywhere in the code, making our code strongly coupled to the presence of these variables. Instead we should select this data via the store and populate the store with the right data on initialization.
[ ] Consistent casing of filenames. Some file names use camelCase, others use kebab-case.
[ ] Use booleans everywhere instead of 0|1 in localized data.
[ ] Remove material-ui from the plugin as a dependency.
[ ] Upgrade babel and remove obsolete dependencies. Move babel config to ./config/babel
[x] Remove lodash as a dependency (we already use the external).
[ ] Replace jed with @wordpress/i18n everywhere and remove the dependency.
[x] Remove unused classnames and dom-scroll-into-view dependencies.
[ ] Replace a11y-speak with @wordpress/a11y everywhere and remove the dependency.
The JavaScript in Yoast SEO has accumulated quite some technical debt. In this issue we can keep track of refactor chores we can do to improve consistency in the JS code base.
camelCase
andsnake_case
. This should be consistent.redux
,react-redux
andredux-thunk
as dependencies.camelCase
, others usekebab-case
.0|1
in localized data.material-ui
from the plugin as a dependency../config/babel
lodash
as a dependency (we already use the external).jed
with@wordpress/i18n
everywhere and remove the dependency.classnames
anddom-scroll-into-view
dependencies.a11y-speak
with@wordpress/a11y
everywhere and remove the dependency.