
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
magix-transform-jsx
Advanced tools
用于将magix代码中的jsx模板写法,转换成magix需要的vdom格式。达到在magix里面写jsx的目的。
目前已经实现jsx的所有语法:示例代码如下:
import * as Magix from "../lib/magix"
import Test from "./test.jsx"
module.exports = Magix.View.extend({
tmpl: function (data) {
var a1='"';
if(data.key==1){
return (
<div data-id="2222">
<Test x="2222" m={{a:1111}} class="xxx"/>
<span class="mmmm" id="2222">1111</span>
<span onClick={this.testcb.bind(this,{a:222})} test="2">2222</span>
</div>
)
}else{
return (
<div data-id="2222">eeeeee</div>
)
}
},
ctor: function (opt) {
},
render: function () {
this.updater.digest()
setTimeout(()=>{
this.updater.set({
"key":1
}).digest()
},1000)
},
testcb: function(data,e){
console.log(data)
}
})
tnpm install magix-transform-jsx --save
配置babel插件
module: {
rules:[
{
test: /\.(jsx|js)$/,
// exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env','stage-0'],
plugins: ['magix-transform-jsx']
}
}
}
]
}
使用api转换
let transform = require('magix-transform-jsx')
transform.parase('')
transform.generate('')
FAQs
将jsx转换到magix的虚拟dom
We found that magix-transform-jsx 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
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.