Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
yoast-components
Advanced tools
React components for use within different Yoast React projects.
You can install yoast-components using npm:
npm install yoast-components
import Input from 'yoast-components/forms/Input'
// Then you can use the Input component within your React components
If you use yoast-components
within your own project we recommend using webpack
with the following loaders and configuration:
Webpack 2+ configuration:
module.exports = {
// ...
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: [ {
loader: "babel-loader",
} ],
},
// ...
],
},
// ...
}
.babelrc
:
{
"presets": ["es2015", "react"]
}
In the entry
of your webpack you should include babel-polyfill as the very first element:
module.exports = {
// ...
entry: [
"babel-polyfill",
// ...
"your-app-entry.js"
]
// ...
}
Some components require implementing a reducer. See which components need what reducers below:
If you wish to use the content analysis component you should implement the contentAnalysisReducer
, located in yoast-components/composites/Plugin/ContentAnalysis/reducers/contentAnalysisReducer.js
. In your root reducer this reducer should have the name contentAnalysis
.
import contentAnalysis from "yoast-components/composites/Plugin/ContentAnalysis/reducers/contentAnalysisReducer.js";
// Your root reducer
combineReducers( {
// ...
contentAnalysis: contentAnalysis,
// ...
} );
yarn install
in the root folder.yarn start
in the root folder.http://localhost:3333
yarn test
To test the code style:
grunt check
Every component should have its own folder named lowercase with the relevant files inside of it. Every component must contain a JavaScript with the component definition in it and exported using export default [Component]
. Any component can contain a SCSS file for relevant CSS and a README.md explaining how the component works.
We use i18n-calypso to localize all components. Refer to their documentation about how to use translate
, moment
and numberFormat
. We don't use the mixin provided. Only use the higher order component to wrap components when they are exported, like so:
import { localize } from 'i18n-calypso'
export default localize( Component );
If you discover any security related issues, please email security [at] yoast.com instead of using the issue tracker.
We follow the GPL. Please see License file for more information.
wordpress-seo
11. With some minor tweaks this can also be used to develop yoast-components within other projects
If you would like to develop yoast-components
within the wordpress-seo
plugin, you can do this quite easily using yarn
.
yoast-components
project to wordpress-seo
using the command line:
yoast-components
project run yarn link
.wordpress-seo
project run yarn link "yoast-components"
.Now you can make development easier by having grunt
watch your files:
wordpress-seo
open Gruntfile.js
.project
, add the following line to paths>files>js[]
:
node_modules/yoast-components/**/*.js
grunt watch
FAQs
Yoast Generic Components
The npm package yoast-components receives a total of 99 weekly downloads. As such, yoast-components popularity was classified as not popular.
We found that yoast-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.