Git Product home page Git Product logo

dna.js's Introduction

DNA.js

An approach to build CS apps using composable abstractions and reactive declarative bindings.

dna.js's People

Contributors

eugenen avatar alexmost avatar

Stargazers

Bloke Common avatar Oleksandr Poliatykin avatar Anton Verinov avatar Piljavsky Sergey avatar  avatar  avatar  avatar

Watchers

Boryslav Larin avatar James Cloos avatar  avatar  avatar Andrii Bovsunovskyi avatar  avatar Igor Mozharovsky avatar  avatar

Forkers

evo-company

dna.js's Issues

Event handler issue.

I have next DNA code:

on-toggle : serialize

Where serialize is:

serialize: (data, opts) ->
    keys = (k for k, _ of data).sort()
    ([k, merge data[k], opts] for k in keys)

...and on-toggle fire next data:

HUB['on-toggle']? data, {label: trend}

I've got a problem ...serialize takes only first argument, data. opts argument is an undefined.
This is my bug or DNA?

Inheritance protocol.

I think it would be good to add the following features:

embedded node inherits parent nodes protocol;

<div data-extend="MyProtocol">
    <span data-subscribe="click : MyProtocol/hide">Content</span>
</div>

In this case inherits MyProtocol.

Merge protocols.

Problem:
Adding snippet code with the DNA on the target site where already started the DNA.

Solution:
If we have several identical protocols on the one page merge them. If there is a merge conflict, throw an error.

Add macros.

If we have:

click : disable | loading | authorize | redirect | finished | enable | hide@olay

...we could make a macros and then use him like this (pseudocode):

click : ~loader [authorize | redirect] | hide@olay

Where loader:

loader = (body) -> "disable | loading | #{body} | finished | enable"

Architecture.

Remove dependency from the jQuery. Make all dependencies in the one package.

On initialization:

dna.start_synthesis ROOT_NODE, DNA_CONFIG

No any other dependencies like libprotocol or console-logger.

Improve data-extend

The protocols that are defined in the data-extend, should replace implementation of the same methods of the protocols that are defined by default.

Example:
default protocol IDom has a method html, custom protocol Appearance also has a method html:
data-extend="Appearance"
data-subscribe='click : "some html" | html'

Now it cause an error. I think that we are should use special symbol / only when conflict of the methods are presented in the defined protocols in the data-extend.

Add ability for the async *cons*.

Example:

loadSummary = (cont) -> get "/summary", (response) -> cont response

module.exports =
    protocols:
        definitions:
            IUser: [
                ['*cons*',  ['cont'], {async: true, concerns: {before: [loadSummary]}}]
            ]

        implementations:
            IUser: (summary) ->

can't find method 0

Если у виджета нет функций (реализация не возвращает объект), то повторный вызов экстенда невозможен

protocol = [
    ['*cons*', [], {concerns: {before: [extract_opts]}}]
]


impl = (node, node_data) ->
    jnode = $ node

    if node_data.Utm
        jnode.mousedown ->
            start_sym = if '?' not in jnode.attr('href') then '?' else '&'
            utm_href = jnode.attr('href') + start_sym + node_data.Utm
            jnode.attr('href', utm_href)
            true
    {} # решение

More composability.

[getValue@field1 getValue@field2 [1 2 3 4 5] | multiplication] | sum

or

[getValue@field1 [getValue@field2 getValue@field3] | multiplication] | sum

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.