0.8.252 • Published 6 years ago

app-decorators v0.8.252

Weekly downloads
3
License
MIT
Repository
github
Last release
6 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

6 years ago

0.8.251

6 years ago

0.8.250

7 years ago

0.8.249

7 years ago

0.8.248

7 years ago

0.8.247

7 years ago

0.8.245

7 years ago

0.8.244

7 years ago

0.8.242

7 years ago

0.8.241

7 years ago

0.8.240

7 years ago

0.8.239

7 years ago

0.8.238

7 years ago

0.8.237

7 years ago

0.8.236

7 years ago

0.8.235

7 years ago

0.8.233

7 years ago

0.8.232

7 years ago

0.8.231

7 years ago

0.8.230

7 years ago

0.8.229

7 years ago

0.8.228

7 years ago

0.8.227

7 years ago

0.8.226

7 years ago

0.8.225

7 years ago

0.8.224

7 years ago

0.8.223

7 years ago

0.8.222

7 years ago

0.8.221

7 years ago

0.8.220

7 years ago

0.8.219

7 years ago

0.8.218

7 years ago

0.8.217

7 years ago

0.8.216

7 years ago

0.8.215

7 years ago

0.8.214

7 years ago

0.8.213

7 years ago

0.8.212

7 years ago

0.8.211

7 years ago

0.8.210

7 years ago

0.8.209

7 years ago

0.8.208

7 years ago

0.8.207

7 years ago

0.8.206

7 years ago

0.8.204

7 years ago

0.8.203

7 years ago

0.8.202

7 years ago

0.8.201

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.510

7 years ago

0.7.5

7 years ago

0.7.4

7 years ago

0.7.302

7 years ago

0.7.3

7 years ago

0.7.202

7 years ago

0.7.201

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.978

7 years ago

0.6.977

7 years ago

0.6.976

7 years ago

0.6.975

7 years ago

0.6.974

7 years ago

0.6.973

7 years ago

0.6.972

7 years ago

0.6.971

7 years ago

0.6.970

8 years ago

0.6.970-alpha.1

8 years ago

0.6.969

8 years ago

0.6.968

8 years ago

0.6.967

8 years ago

0.6.966

8 years ago

0.6.965

8 years ago

0.6.964

8 years ago

0.6.963

8 years ago

0.6.962

8 years ago

0.6.961

8 years ago

0.6.96

8 years ago

0.6.95

8 years ago

0.6.94

8 years ago

0.6.93

8 years ago

0.6.92

8 years ago

0.6.91

8 years ago

0.6.90

8 years ago

0.6.89

8 years ago

0.6.88

8 years ago

0.6.87

8 years ago

0.6.86

8 years ago

0.6.85

8 years ago

0.6.84

8 years ago

0.6.82

8 years ago

0.6.81

8 years ago

0.6.80

8 years ago

0.6.79

8 years ago

0.6.78

8 years ago

0.6.77

8 years ago

0.6.76

8 years ago

0.6.75

8 years ago

0.6.74

8 years ago

0.6.73

8 years ago

0.6.72

8 years ago

0.6.71

8 years ago

0.6.7

8 years ago

0.6.64

8 years ago

0.6.63

8 years ago

0.6.62

8 years ago

0.6.61

8 years ago

0.6.60

8 years ago

0.6.57

8 years ago

0.6.56

8 years ago

0.6.55

8 years ago

0.6.54

8 years ago

0.6.53

8 years ago

0.6.52

8 years ago

0.6.51

8 years ago

0.6.11

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.3.29

8 years ago

0.3.28

8 years ago

0.3.27

8 years ago

0.3.26

8 years ago

0.3.25

8 years ago

0.3.21

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago