
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
react-imvc
Advanced tools
MVC 三者都是 Isomorphic,既是服务端 MVC,也是浏览器端 MVC。
react-imvc 是 isomorphic mvc 的 react 实现,它是一个 Web 框架。通过 react-imvc,我们可以更便利地实现同构 Web 应用的开发。
用法示例:
react-imvc 是一个整体解决方案,包括服务端和客户端,所以必须从 npm 或 yarn 里下载到 package.json 里。
npm install --save react react-dom react-imvc
在你的 package.json 里添加 npm scripts 如下命令:
{
"scripts": {
"start": "react-imvc start",
"build": "react-imvc build",
"test": "react-imvc test"
}
}
在 package.json 所在的目录下,新建一个文件夹,名称为 src
在 src 文件夹里新增 index.js 入口文件,添加一组 {path, controller} 的路由配置
// src/index.js
export default [
{
path: '/',
controller: () => import('./home/Controller')
}
]
每个页面必须是一个包含 controller.js 的文件夹,其中 controller.js 是页面的入口文件
// src/home/Controller
import Controller from 'react-imvc/controller' // 加载 react-imvc controller 控制器
import React from 'react'
export default class Home extends Controller { // 继承它,编写你的控制器逻辑
View = View // 将 react 组件赋值给控制器的 View 属性
}
function View() {
return (
<h1>Hello React-IMVC</h1>
)
}
在命令行输入 npm start,然后打开 http://localhost:3000
,将看到 Hello React-IMVC
查看页面源代码,可以看到服务端渲染的内容。
FAQs
An Isomorphic MVC Framework
The npm package react-imvc receives a total of 27 weekly downloads. As such, react-imvc popularity was classified as not popular.
We found that react-imvc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.