FlowMind:摩根大通自动化金融工作流程
摩根大通人工智能研究部最近推出了一款名为FlowMind的先进工具,旨在通过利用GPT技术自动生成工作流程,……...
Fre (发音/fri:/
, like free)是一个小而美的前端框架,实现了 Concurrent和Suspense
特性:
函数式组件与hooks API
并发与 Suspense
keyed reconcilation algorithm
安装
yarn add fre -S
使用
import { render, h, useState } from 'fre'function Counter() { const [count, setCount] = useState(0) return ( <div> <h1>{count}</h1> <button onClick={() => setCount(count + 1)}>+</button> </div> )}render(<Counter />, document.getElementById('app'))
hooks API
import { render, useState, h } from "fre"function Sex() { const [sex, setSex] = useState("boy") return ( <div class="sex"> <button onClick={() => setSex(sex === "boy" ? "girl" : "boy")}>x</button> <Counter sex={sex} /> </div> )}function Counter(props) { const [count, setCount] = useState(0) return ( <div class="counter"> <h1>{props.sex}</h1> <button onClick={() => setCount(count + 1)}>+</button> <h1>{count}</h1> </div> )}render(<Sex />, document.getElementById("app"))
props
虽然 hooks API 使得 state 在 function 内部受控,但是 props 仍然是这个组件从外部接受的√
如下,sex 就是从父组件传下来的
function Counter(props) { const [count, setCount] = useState(0) return ( <div class="counter"> <h1>{props.sex}</h1> <button onClick={() => setCount(count + 1)}>+</button> <h1>{count}</h1> </div> )}
JSX
默认也对外暴露了 h 函数,可以选用 JSX
import { h } from 'fre'
webpack 需配置:
{ "plugins": [ ["transform-react-jsx", { "pragma":"Fre.h" }] ]}
keyed-diff-patch
基于fiber链表的diff方案,使用hash标记位置,更方便的比对
Concurrent
异步渲染,通过时间切片,suspense的方式,对任务进行优先级调度,打断继续任务
摩根大通人工智能研究部最近推出了一款名为FlowMind的先进工具,旨在通过利用GPT技术自动生成工作流程,……...
CDE是一个自动包装运行一个Linux命令所涉及的代码、数据和环境的工具,所打成的包可以在另一台电脑上同等……...
Nodemon 是一款非常实用的工具,用来监控你 node.js 源代码的任何变化和自动重启你的服务器。 Nodemon 是……...
par 是一个基于 pyPEG 写的转換 markdown 为 html 的工具,它是用 python 语言开发的。 除了支持标准的 m……...
DTM 是首款 golang 的开源分布式事务管理器,优雅的解决了幂等、空补偿、悬挂等分布式事务难题。在微服务……...
CDNJS 是一个通过快速 CDN 基础设施为开发人员和组织提供流行的前端 Web 开发资源的项目,帮助代码库与框……...
Stencil 是一个 CodeIgniter 的模板引擎,通过简单可靠的方式来渲染 HTML 页面。 控制器: <?phpif(!defined('BASEPATH'))exit('Nodirectscriptaccessallowed');classHomeextendsCI_Controller{publicfunction_……
项目背景 蘑菇街能有今天的快速发展,得益于开源软件群雄崛起的大环境背景,我们一直对开源社区怀有感恩之情,因此也一直希望能为开源社区贡献一份力量。 2013年我们蘑菇街从社区导购华丽转身时尚电商平台,为解决……
GoDS 是一个 Go 语言实现的各种数据结构的工具包,包括: Containers (Sets, Lists, Stacks, Maps, Trees), Sets (HashSet, TreeSet, LinkedHashSet), Lists (ArrayList, SinglyLinkedList, DoublyLinkedList), St……