
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
@m860/cerberus
Advanced tools
react-native微应用/微组件纯JS解决方案
安装cerberus-cli
$ npm i -g @m860/cerberus-cli
添加cerberus-cli配置文件 配置参数
$ touch cbs.json
启动本地服务
$ npx cbs start cbs.json
安装cerberus
$ npm i @m860/cerberus
使用useCerberus加载
import * as React from "react"
import {useCerberus} from "@m860/cerberus"
export default function(){
const [status,defined]=useCerberus({
entry:"http://localhost:9000/main.js"
});
if(defined){
const {default:App}=defined;
return <App/>
}
return null;
}
NOTE: 目前只支持hooks
type ConfigOption={
// 同webpack.mode
mode:string,
// 同webpack.entry
entry:any,
// 同webpack.output
output:any,
/**
* 需要替换的module
*
* @example
* {
* cerberusTransformOption:{
* modules:["dateformat"]
* }
* }
*
*/
cerberusTransformOption:{
modules:Array<string>,
/**
* 需要处理的资源文件的正则表达式,默认:/\.(gif|png|jpeg|jpg|svg)$/i
*/
resourceTest?:?RegExp
}
}
cerberus来管理组件// 在App中使用CerberusContextProvider来自定义client
import * as React from "react"
import {CerberusContextProvider} from "@m860/cerberus"
export default function (){
return (
<CerberusContextProvider value={{
client:{
uri:"http://xxx"
}
}}>
</CerberusContextProvider>
);
}
图片没有显示出来
cli在编译的时候将本地引用的图片编译为uri的方式,所以必须设置width和height才能够正常显示
<Image source={require("image.png")} style={{width:100,height:100}}/>
debug模式下缓存不生效
queryEntry参数的urls的顺序和配置文件中的顺序可能不一致,不要使用如下方式:(urls)=>urls[2]
FAQs
react-native小程序
The npm package @m860/cerberus receives a total of 13 weekly downloads. As such, @m860/cerberus popularity was classified as not popular.
We found that @m860/cerberus 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.

Security News
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.