Giter Club home page Giter Club logo

Comments (5)

hooksw avatar hooksw commented on July 19, 2024

说英语好累,还是说中文吧。
关于这个问题,除了文档里说的,还有没有要补充的 @Peanuuutz

from konify.

Peanuuutz avatar Peanuuutz commented on July 19, 2024

双向绑定机制 OK。

节点系统,我仍然认为注入节点树更妥当,因为响应机制是全局的(所有节点树都能够响应同一信号),而节点树是局部的(不同节点树之间不能发生干扰),后者不应该为了所谓的“一致性”而以相同方式(全局变量)实现。

from konify.

hooksw avatar hooksw commented on July 19, 2024

全局变量的使用沿袭于SolidJS, 由于js是单线程语言,并且Solid作为UI框架是始终会在主线程进行状态跟踪的,所以全局变量是ok的。
现在考虑到有可能会拓展到更多情景,需要因地制宜。
不过关于节点树的方式,有一些问题需要探讨:

  1. 节点树之间不能产生冲突,那么响应机制的currentComputation是否也要绑定到节点树上面,同时,目前的响应式机制依赖于单个线程和全局变量访问,而一旦绑定,对于单个树的操作,也会受到限制(可以配套一个eventloop来处理)。
  2. 节点树的方式大概需要怎么设计,包括节点树的创建和提供,节点树会有哪些操作,节点树之间的交互(比如嵌套?)

from konify.

hooksw avatar hooksw commented on July 19, 2024

鉴于目前没有更多人参与,先采用NodeTree的方案。
那么我们目前需要实现几点:

  1. NodeTree的设计
interface NodeTree{
    val currentNode:Node
    //TODO
    //是否要实现树的遍历,遍历方式是通过添加Node.parent和Node.children还是全部通过NodeTree维护(比如NodeTree里面维护一个数据结构,存储每个节点的parent和children)
    //节点的创建和删除依赖于上述遍历方式的实现
}
  1. NodeTree的提供
    选择在最外层包裹一个常规的提供NodeTree的函数是否可行?
fun factory(tree:NodeTree, block:@Component ()->Unit){
    error("intrinsic implemention")
}
  1. 和Computation的集成
    由于响应式限制在单线程环境,那么有很大可能NodeTree需要与其集成
    假定我们把computation放在NodeTree中。
    会涉及到一个问题:
    Signal等响应式原语如何获取currentComputation? 集成后,如果要获取它,需要先获取NodeTree,意味着signal.value的get属性需要带上注解,它将只能在Component函数中使用,这个影响大吗?虽然Compose基本也是将state用在Composable函数中,但不确定在konify中对其他场景是否同样适用(如果这个矛盾无法调和,那么将还是将以UI为主,暂时不考虑UI以外的情景)

from konify.

hooksw avatar hooksw commented on July 19, 2024

The issue is out of date and is now closed

from konify.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.