RAD 是一个零依赖的前端框架,专为使用 Dart 构建高性能 Web 应用而设计。它使开发者能够在无外部依赖的情况下创建快速、可扩展的 Web 应用,专注于简单性和效率。RAD 专为 Web 而构建,利用 Dart 的功能以最小开销提供响应式用户界面。该框架非常适合对性能和轻量级架构要求较高的项目。其简洁的设计促进了快速开发,并易于集成到现有工作流程中。
适合场景
构建高性能的Web应用程序
创建轻量级单页应用
使用 Dart 快速原型设计
开发服务器端渲染的网页内容
与 Flutter Web 项目集成
主要特点
零外部依赖
针对网页性能进行了优化
最小化样板代码
Dart 原生语法
内置路由和状态管理
轻量且模块化的架构
适合对象
寻求轻量级 Web 框架的 Dart 开发者
优先考虑速度和效率的项目
Flutter Web 开发人员扩展 Web 功能
希望设置和配置最少的团队
前端开发人员避免使用重型框架
使用建议
与更大的框架相比,生态系统有限
仍在发展,社区资源较少
不适合复杂的后端密集型应用
需要熟悉 Dart
最适合无需支持旧版浏览器的现代网络浏览器
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
Rad
Rad is a frontend framework for creating fast and interactive web apps using Dart. It has all the best bits of Flutter(StatefulWidgets, Builders) and React(Hooks, Performance), and allows you to use web technologies(HTML and CSS) in your app.
Function runApp will finds a element having id=output in your HTML page, create a Rad app with it, and then displays "hello world" inside of it. As you might have guessed it, Text('hello world') is a widget, a special purpose widget provided by the framework that we're using to display desired text on the screen. Rad provides number of widgets that you can use and best thing about widgets is that you can compose them together to create more widgets and build complex layouts.
Flutter widgets
Following widgets in Rad are inspired from Flutter:
These widgets has same syntax as their Flutter's counterparts. Not just syntax, they also works exactly same as if they would in Flutter. Which means you don't have to learn anything new to be able to use them.
React hooks
Similar to React, we have number of hooks that you can use to power-up your widget functions.
There's also an alternative syntax for all HTML widgets:
div(
children: [
p(innerText: 'Hey there!'),
]
)
Apart from syntax/names, HTML widgets are composable and has same semantics in the sense that they can be composed and mixed together with other widgets. For example,
In above example, a Span widget is containing a ListView widget. Further, that ListView is containing a StatefulWidget and a Span widget. The point we're trying to make is that HTML widgets won't restrict you to 'just HTML'.
Provides an enhanced development experience for developers working with the Rad Framework. With its powerful features, this extension makes it easier for developers to write and manage code, saving time and increasing productivity. Extension's top features are:
Visual JSX: Transforms your HTML widgets into a visually appealing, JSX-like syntax.
Click to See Preview
HTML2Rad: Converts your HTML markup directly into Rad's HTML widgets.
Click to See Preview
Reference
Below is the list of available widgets and hooks in Rad. Some widgets are named after Flutter widgets because they either works exactly same or can be used to achieve same things but in a different way(more or less). All those widgets are tagged accordingly.
Tags:
exact: Exact syntax, similar semantics.
same: Exact syntax with few exceptions, similar semantics.