6

开箱即用的渐进式前端开发框架 dagger.js

 1 year ago
source link: https://www.v2ex.com/t/862239
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  前端开发

开箱即用的渐进式前端开发框架 dagger.js

  dagger8224 · 9 小时 0 分钟前 · 321 次点击

向大家推荐一个轻量完备的描述式开源前端框架dagger.js

与 React/Vue 等主流框架相比,dagger.js 提供了更加简单易用的代码组织方式:指令是业务代码的唯一调用入口(指令中可以使用作用域和模块回调参数)。 使用 dagger.js ,您将不再需要:

构建和包管理工具依赖

dagger.js 工作在浏览器运行时环境当中,无需编译构建过程。通过 script 标签引入框架脚本即可轻松完成应用程序创建。dagger.js 实现了一个运行时模块管理器,按需动态加载解析模块。为您的应用做极限瘦身。demo

运行时第三方核心代码依赖

dagger.js 内置了基于 hash 的路由管理逻辑。您无需为开发单页应用引入额外的路由管理类库。demo

状态管理

dagger.js 倡导数据即状态的技术理念。有别于 React/Vue 单向数据流模型 state(data)/prop 的区分定义,在 dagger.js 中,数据作用域独立于页面组件定义,并具有全域视图响应性。指令作为数据的消费者,可以自由读写其声明位置上可见的作用域字段,您无需再为组件间数据状态同步而劳心费神。demo

api 调用

dagger.js 是去组件化的( componentless ),并非基于传统的 MVVM 设计模式实现。对于使用者来说,数据( Model )通过指令声明方式直接与上下文视图( View )建立动态关联。在大多数场景下您无需调用任何 api 即可完成业务开发工作。demo

更多介绍请参见官方文档

Talk is cheap, let's see the code😄:

empty entry
Hello dagger
scope demo animation
communication between isolate $scope
lifeCycle directives
html directive
add tags
to do list
Tic Tac Toe
module
router
router view toggle each

欢迎大家体验试用 dagger.js ,提出宝贵意见和建议。您的支持和帮助是对我莫大的鼓励!!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK