0.8.252 • Published 8 years ago

app-decorators v0.8.252

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

app-decorates (Beta)

Quickstart with app-decorators-cli

# For Mac
npm install appdec-cli-osx --global

# For Windows
npm install appdec-cli-win --global

# For Linux
npm install appdec-cli-linux --global

# then
appdec create --name mymodule
appdec run --name mymodule --watch --server

See app-decorators-cli(Beta)


Why app-decorators?

  • compiler first AOT-Compiler, do computation at compile time and not at runtime
  • write less, do more
  • and more (coming soon)

Runtime package

PackageVersionDependenciesDevDependencies
app-decoratorsnpmDependency StatusDevDependency Status

Core compiler packages

PackageVersionDependenciesDevDependencies
app-decorators-componentnpmDependency StatusDevDependency Status
app-decorators-view-precompilenpmDependency StatusDevDependency Status
app-decorators-style-precompilenpmDependency StatusDevDependency Status
app-decorators-component-registernpmDependency StatusDevDependency Status
postcss-parse-atrule-eventsnpmDependency StatusDevDependency Status
preset-app-decoratorsnpmDependency StatusDevDependency Status

Command line tools (Cli) for Mac, Linux or Windows

PackageVersionDependenciesDevDependencies
appdec-cli-osxnpmDependency StatusDevDependency Status
appdec-cli-winnpmDependency StatusDevDependency Status
appdec-cli-linuxnpmDependency StatusDevDependency Status

Todomvc

PackageVersionDependenciesDevDependencies
app-decorators-todomvcnpmDependency StatusDevDependency Status

Simple example

Item.js
import { component, view, on, action, style } from 'app-decorators';

@style(`
    /** These atrule (@) events will be loaded asynchronous (non blocking) **/
    
    /** will be loaded on load event **/
    @on load {
        @fetch path/to/on/load.css;
    }
    
    /** will be loaded when clicked .up class **/
    @on click .up {
        @fetch path/to/on/click/up.css;
    }

    /** will be loaded when url changed **/
    @action hello/my/friend.html {
        @fetch path/to/on/some/route/action.css;
    }

    /** critical path (inline css will appear immediately) **/
    my-box div {
        width: 100px;
        height: 100px;
    }
`)
@view(`
    <h3>{{head}}</h3>
    <div class="count">{{count}}</div>
    <div>
        <span class="up"> + </span>
        <span class="down"> - </span>
    </div>
    <div>
        <a href="?state=reset">clear count</a>
        <a href="?state=destroy">destroy</a>
        <a href="hello/my/friend.html">destroy</a>
    </div>
`)
@component({
    name: 'my-box'
})
class Item {

    @view.bind count = 0;
    
    @on('click .up') onClickUp() {
        ++this.count
    }
    
    @on('click .down') onClickUp() {
        --this.count
    }
    
    @action('?state={{type}}') onUrlStateChanged({ params }){
        
        let { type } = params;
        if(type === 'reset'){
            this.count = 0;   
        }
        // remove it self
        else if(type === 'destroy') {
            this.parentNode.removeChild(this);
        }
    }
}

export {
    Item
}

app.js

let item = Item.create({
    head: 'Some description'
});

document.body.appendChild(item);

Result in Markup

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>my com-item</title>
    </head>
    <body>
        <com-item>
            <!-- for fast rendering, style will be appended onLoad -->
            <style>
                my-box h3 {
                    font-size: 14px;
                }
                my-box div {
                    border: 1px solid gray;
                }
            </style>
            <h3>Some description</h3>
            <div class="count">0</div>
            <!-- on click .up or .down it will increment/decrement .count -->
            <div>
                <span class="up"> + </span>
                <span class="down"> - </span>
            </div>  
            <div>
                <a href="?state=reset">clear count</a>
                <a href="?state=destroy">destroy</a>
            </div>
        </com-item>
    </body>
</html>

Its also possible to put <com-item></com-item> direct in the dom like:

<body>
    <!-- It will render, see above (result in markup) -->
    <com-item></com-item>
</body>

Browser Support

TablesVersion
Chromelatest stable
Edgelatest stable
Firefoxlatest stable
Operalatest stable
Safari MacOS>= 9
IE>= 11
----------------------------------------------------------
iOS Safari>= 10.0.0
iOS Chrome>= 58.0.0
iOS Firefox>= 55.0.0
----------------------------------------------------------
Android Chrome>= 58.0.0
Android Firefox>= 55.0.0

Documentation

Decorators
Libraries

Tests and Contributors guidelines

// init
npm install --global lerna

// install and test packages
make lerna-bootstrap
make lerna-test

// install and compile for browser tests
make install
make compile // required for node css fixture server
make test // and run this in separate window

Contributors guidelines (currently internal info)

build new binary on new version

Contributors guidelines (currently internal info)

// init
npm install --global lerna

// lerna-bootstrap for packages
lerna bootstrap -- --no-package-lock

// or make install for acceptance tests
cd packages/app-decorators
jspm install
cd ../..
make prepare-compile // ignore the :4000 error
make gulp-compile

// browser test
make test

// packages test
make lerna-test

// clean packages
make lerna-clean
make clean
git checkout packages/app-decorators/package.json
git checkout jspm.config.js

// when publish
- *1 update in package.json version
- update babel-preset-app-decorators to same in *1
- packages/app-decorators-todomvc update preset

app-decorators and its packages are distributed as a monorepo.

(c) 2015 - 2018 Serkan Sipahi

App-Decorators may be freely distributed under the MIT license.

0.8.252

8 years ago

0.8.251

8 years ago

0.8.250

8 years ago

0.8.249

8 years ago

0.8.248

8 years ago

0.8.247

8 years ago

0.8.245

8 years ago

0.8.244

8 years ago

0.8.242

8 years ago

0.8.241

8 years ago

0.8.240

8 years ago

0.8.239

8 years ago

0.8.238

8 years ago

0.8.237

8 years ago

0.8.236

8 years ago

0.8.235

8 years ago

0.8.233

8 years ago

0.8.232

8 years ago

0.8.231

8 years ago

0.8.230

8 years ago

0.8.229

8 years ago

0.8.228

8 years ago

0.8.227

8 years ago

0.8.226

8 years ago

0.8.225

8 years ago

0.8.224

8 years ago

0.8.223

8 years ago

0.8.222

8 years ago

0.8.221

8 years ago

0.8.220

8 years ago

0.8.219

8 years ago

0.8.218

8 years ago

0.8.217

8 years ago

0.8.216

8 years ago

0.8.215

8 years ago

0.8.214

8 years ago

0.8.213

8 years ago

0.8.212

8 years ago

0.8.211

8 years ago

0.8.210

8 years ago

0.8.209

8 years ago

0.8.208

8 years ago

0.8.207

8 years ago

0.8.206

8 years ago

0.8.204

8 years ago

0.8.203

8 years ago

0.8.202

8 years ago

0.8.201

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.510

8 years ago

0.7.5

8 years ago

0.7.4

8 years ago

0.7.302

8 years ago

0.7.3

8 years ago

0.7.202

8 years ago

0.7.201

8 years ago

0.7.2

8 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.978

9 years ago

0.6.977

9 years ago

0.6.976

9 years ago

0.6.975

9 years ago

0.6.974

9 years ago

0.6.973

9 years ago

0.6.972

9 years ago

0.6.971

9 years ago

0.6.970

9 years ago

0.6.970-alpha.1

9 years ago

0.6.969

9 years ago

0.6.968

9 years ago

0.6.967

9 years ago

0.6.966

9 years ago

0.6.965

9 years ago

0.6.964

9 years ago

0.6.963

9 years ago

0.6.962

9 years ago

0.6.961

9 years ago

0.6.96

9 years ago

0.6.95

9 years ago

0.6.94

9 years ago

0.6.93

9 years ago

0.6.92

9 years ago

0.6.91

9 years ago

0.6.90

9 years ago

0.6.89

9 years ago

0.6.88

9 years ago

0.6.87

9 years ago

0.6.86

9 years ago

0.6.85

9 years ago

0.6.84

9 years ago

0.6.82

9 years ago

0.6.81

9 years ago

0.6.80

9 years ago

0.6.79

9 years ago

0.6.78

9 years ago

0.6.77

9 years ago

0.6.76

9 years ago

0.6.75

9 years ago

0.6.74

9 years ago

0.6.73

9 years ago

0.6.72

9 years ago

0.6.71

9 years ago

0.6.7

9 years ago

0.6.64

9 years ago

0.6.63

9 years ago

0.6.62

9 years ago

0.6.61

9 years ago

0.6.60

9 years ago

0.6.57

9 years ago

0.6.56

9 years ago

0.6.55

9 years ago

0.6.54

9 years ago

0.6.53

9 years ago

0.6.52

9 years ago

0.6.51

9 years ago

0.6.11

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.3.29

10 years ago

0.3.28

10 years ago

0.3.27

10 years ago

0.3.26

10 years ago

0.3.25

10 years ago

0.3.21

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago