Installations
npm install gatsby-plugin-react-decorators
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
21.5.0
NPM Version
10.2.4
Score
22.6
Supply Chain
52.2
Quality
64.6
Maintenance
50
Vulnerability
91.7
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
smithc
Download Statistics
Total Downloads
671,267
Last Day
298
Last Week
1,198
Last Month
3,650
Last Year
80,278
GitHub Statistics
14 Commits
3 Branches
1 Contributors
Bundle Size
263.00 B
Minified
176.00 B
Minified + Gzipped
Package Meta Information
Latest Version
3.0.0
Package Id
gatsby-plugin-react-decorators@3.0.0
Unpacked Size
22.15 kB
Size
11.72 kB
File Count
15
NPM Version
10.2.4
Node Version
21.5.0
Publised On
30 Jan 2024
Total Downloads
Cumulative downloads
Total Downloads
671,267
Last day
2.4%
298
Compared to previous day
Last week
45.9%
1,198
Compared to previous week
Last month
14.8%
3,650
Compared to previous month
Last year
-12%
80,278
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Peer Dependencies
3
Setup
- Install the package
npm install gatsby-plugin-react-decorators
- Configure the plugin in your local
gastby-config.js
file
// gatsby-config.js
const opts = require('gatsby-plugin-react-decorators').decoratorOptions;
module.exports = {
plugins: [
{
resolve: "gatsby-plugin-react-decorators",
options: {
react: {
options: opts.runtime | opts.ssr
},
reactDOM: {
options: opts.runtime | opts.ssr | opts.enableProfiler
}
},
}]
}
Note that the opts.enableProfiler
option (enabled by default) will enable the React profiler (as if you had added the --profile
option to gatsby build
/gatsby develop
, or manually specified react-dom/profiling
as a webpack alias for react-dom
).
- Register your local decorators
If you're using decorators during the server-side render process, add the following to your gatsby-ssr.js
file:
// gatsby-ssr.js
import { registerDecorator } from 'webpack-decorators';
// This code can be executed immediately
const exampleDecorator = {
createElement: function(originalFunc, ...args) {
// Put your custom logic here...
return originalFunc(...args);
}
};
registerDecorator('react', exampleDecorator, 'createElement');
If you're using decorators during runtime (in the browser), add the following to your gatsby-browser.js
file:
// gatsby-browser.js
import { registerDecorator } from 'webpack-decorators';
export const onClientEntry = () => {
const exampleDecorator = {
createElement: function(originalFunc, ...args) {
// Put your custom logic here...
return originalFunc(...args);
}
};
registerDecorator('react', exampleDecorator, 'createElement');
};
Note:
You can register multiple decorators with multiple
registerDecorator
statements.
Version Notes
Package version 3.0 and up support React/React-Dom 17.0.1 and up.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 0/13 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Score
3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More