
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@braken/react
Advanced tools
Braken 框架的 React 集成模块,提供基于 React 的前端应用开发支持。
pnpm add @braken/react
import { Application, Controller } from '@braken/react';
// 创建应用实例
const app = new Application('/app');
// 定义控制器
class HomeController extends Controller {
render() {
return <div>Welcome to Home</div>;
}
}
// 定义用户控制器
class UserController extends Controller {
render() {
const { params } = app.useLocation();
return <div>User: {params.id}</div>;
}
}
// 注册路由
app.get('/', HomeController);
app.get('/user/:id', UserController);
// 添加全局中间件
app.use('global', (props, next) => {
console.log('Global middleware');
return next();
});
// 添加路由中间件
app.use('router', (props, next) => {
console.log('Router middleware');
return next();
});
// 添加错误处理组件
app.addStatusListener(404, ({ status, message }) => (
<div>Page not found: {message}</div>
));
// 渲染应用
app.render(document.getElementById('root'));
主要的应用类,提供以下功能:
constructor(prefix: string = '/')
get(path: string, controller: Controller)
post(path: string, controller: Controller)
put(path: string, controller: Controller)
delete(path: string, controller: Controller)
use(type: MiddlewareType, ...middleware: Middleware[])
redirect(url: string)
replace(url: string)
reload()
render<T extends HTMLElement>(
id: T,
manifest: { path: string, controller: Controller }[] = [],
notfound?: ReactNode
)
控制器基类,提供以下功能:
class MyController extends Controller {
render() {
return <div>My Page</div>;
}
}
type MiddlewareType = 'global' | 'router';
type Middleware = (props: LocationProps, next: () => ReactNode) => ReactNode;
interface LocationProps {
pathname: string;
query: Record<string, string>;
hash: string;
params: Record<string, string>;
}
@Application.Injectable
class MyService {
@Application.Inject(Request)
private readonly request: Request;
}
MIT
FAQs
somethings
We found that @braken/react demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.