Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jsx-to-shaco
Advanced tools
This is a module to use with babel-plugin-transform-jsx and create Shaco Elements using JSX. This allow you to use JSX inside the view function
First install the necesary dependencies
npm install --save-dev babel-plugin-transform-jsx jsx-to-shaco
Add to your package.json babel configuration the babel-plugin-transform-jsx and set the jsx-to-shaco module:
"plugins": [
[
"transform-jsx", { "module": "jsx-to-shaco" }
]
]
if your are using browserify, your browserify configuration on your package.json maybe will se something like this
"browserify": {
"transform": [
[
"babelify",
{
"plugins": [
[
"transform-jsx", { "module": "jsx-to-shaco" }
]
],
"presets": [
"es2015",
"stage-2"
]
}
]
]
}
The view function inside a component must have this structore
... // Omitted other parts of the Shaco.ComponentFactory object
view: function() {
// you can put variables in here
return (
<div>
<h1>Hello World</h1>
<p>{this.state.usingVariables}</p>
</div>
)
}
...
view: function() {
return (
<ul>
{ this.state.someArray.map((someOne, index) => {
return (
<li key={index}> { someOne} </li>
)
})}
</ul>
)
}
view: function() {
return (
<todo-item state={stateObj}></todo-item>
)
}
You can use normal HTML attributes like
No camel case needed, only regular HTML definition
FAQs
Babel plugin to precompile JSX to Shaco.createElement
The npm package jsx-to-shaco receives a total of 1 weekly downloads. As such, jsx-to-shaco popularity was classified as not popular.
We found that jsx-to-shaco demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.