GithubHelp home page GithubHelp logo

corejs's Introduction

The library has been created by Samsung Electronics Co., Ltd. but since it is licensed under an open source license (Apache License, Version 2.0) I created a public repository using the code imported from the Tizen SDK. You are welcome to fork the repository and to submit pull requests.

CoreJS Micro Framework

The core.js Micro Framework is a small, modular application framework designed specifically for Tizen Web Applications.

Overview

The web applications based on CoreJS usually use a simple MVP (Model View Presenter) architecture.

The core part determines the architecture and the app part determines the application behavior.

Overview of core.js

The core.js file implements a simple AMD-like loader. It's similar to requirejs (although the formats are not compatible), but it's much lighter and therefore more suitable for devices with low memory and processing power such as the Samsung Gear series.

Modules definition organizes code into simple units (modules). Module can refer to other modules – dependency references.

Overview of modules

The modules help with the development of web applications. Many of them are based on Tizen APIs and provide easier to system functions and add some useful higher-level functionalities.

Loading

core.js loads files with a different approach than <script> tags in HTML file.

core.js loads each file as a script tag, using document.createElement and head.appendChild and then waits for all dependencies to load, figures the right order to call definitions of module.

Usage

Adding core.js to index.html:

<script src="./js/libs/core/core.js" data-main="./js/app.js"></script>

Where app.js is the main application module.

define({
    name: 'app',
    def: function def() {}
});

Defining a module

A module is a file with simple code unit, different from a traditional script file. Modules keep the global (window) namespace clean, no variables are created in the global scope. Any valid return from a module is allowed - the module can return an object, a function or nothing. If the module definition returns and object with with an init method, then this method with be automatically called so the module will be initialized. There should only be one module definition per file.

Contributors

  • Sergiusz Strumiński
  • Paweł Sierszeń
  • Kamil Stepczuk

corejs's People

Contributors

nix1 avatar stepek avatar

Watchers

 avatar

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.