Skip to content

ido-ofir/core.web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

core.web

The basic web client for the core.

installation

npm i --save core.web

usage

initial rendering

load your app as a plugin, then render one of it's components:

// entry point of your bundler

var React = require('react');
var ReactDom = require('react-dom');
var core = require('core.web');

core.plugin([
    require('./myApp')
]);

core.require([
    'myApp.Root'
], Root => 
    ReactDom.render(<Root/>, document.getElementById('app'))
)
// ./myApp/index.js

module.exports = {
    name: 'myApp',
    components: [
        {
            name: 'Root',
            get(){
                
                return {
                    render(){
                        return <div> App Root </div>;
                    }
                }
            }
        }
    ]
}

plugin definition

module.exports = {
    name: 'somePlugin',
    modules: [
        require('./modules/moduleA')
    ],
    components: [
        require('./components/ComponentA')
    ],
    actions: [
        require('./actions/actionA')
    ],
    views: [
        require('./views/ViewA')
    ],
    types: [
        require('./types/typeA')
    ],
    init(definition, done){
        
        let somePlugin = {
            doStuff(){ ... }
        };
        
        done(somePlugin);
    }
}

About

The common web client setup for core.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published