Giter Site home page Giter Site logo

javey / intact Goto Github PK

View Code? Open in Web Editor NEW
56.0 2.0 7.0 10.22 MB

An inheritable and strong logic template front-end mvvm framework.

Home Page: https://javey.github.io/Intact

JavaScript 96.18% CSS 0.39% HTML 0.06% Stylus 3.38%
virtual-dom mvvm-framework

intact's People

Contributors

dependabot[bot] avatar javey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

intact's Issues

RFC

是否要实现Fragment

如果组件可以返回多个节点,如何兼容Vue/React

是否要实现函数式组件

函数式组件如果返回多个节点,如何兼容Vue/React

should normalize props.children especially

For children of component, misstime should normalize them. So we can iterate them like a flattened array. But should not add key for them. The key should be added in html element. Otherwise the keys may be conflicted.

<Component>{[<div></div>, 1]} 2</Component>

=> flatten

<Component><div></div>1 2</Component>

How to make a leaving element enter coherently?

When enter a leaving element. misstime will append it, this operation will lead to the last leaving animation breaks. If we don't append the dom, then how to keep the order of the dom correctly?

set method support set object value by path

The set method should support set object type value by path like bellow:

this.set({'a.b': 1, 'a.c': '2'}, {path: true});
// trigger $change:a.b $change:a.c $change:a $change $changed:a.b $changed:a.c $changed:a $changed
this.get('a') // {b: 1, c: '2'}

support property validate and correct

Support validate and correct property like bellow:

class A extends Intact {
    static propTypes = {
        show: Boolean,
        name: {
            type: Number,
            fix: (value) => {
                return Number(value);
            }
        }
}

Enter animation does not work in firefox

When a element is entering. It will be added enter className, then we call getAnimateType method will add enter-active className. In this case the animation has been triggered in firefox. So we should call getAnimateType method before adding enter className.

can not set block in nested component

Such as

// AnotherComponent
<div>{self.get('children)}</div>
// Component
<div>
    <AnotherComponent>
        <b:body>test</b:body>
    </AnotherComponent>
</div>
<Component>
    <b:body>component</b:body>
</Component>

if AnotherComponent have not a block named body, the content wich passd as block in Component will be ignored. Because the body block is a blocks property for AnotherComponent, not children.
Howerver you can do like this:

<div>
    <AnotherComponent>
        <div>
            <b:body>test</b:body>
        </div>
    </AnotherComponent>
</div>

appear animation

Update an Animate component when it's rendering, the isRender flag will be set to false. This make the component trigger enter animation when mount it. But it is rendering in fact.
We should set isRender to false in this case.

Add _beforeCreate lifecycle method

_init: can't get vNode and operate vNode;
_create: can operate vNode but it is too late and must make component to update
Add a _beforeCreate lifecycle method between _init and _create to operate vNode before render.

Should freeze the property passed to component

When we pass a Object to child component, the child component may change the property of that Object. But the $change event can not to be triggered.

class A extends Intact {
     defauts() {
        return {data: {}};
    },
    change() {
        // this set will trigger '$change:data.a' and '$change:data' events
        this.set('data.a', 1);
   }
}
// when the users has changed by `change` method of A component
// we can not get the `$change:user.a` and `$change:user` events
<A data={self.get('user')} />

So we should freeze the property which passed to child component.

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.