All Projects → mbasso → Gccx

mbasso / Gccx

Licence: mit
Transforms CPX (JSX like syntax) into asm-dom Virtual DOM

Programming Languages

javascript
184084 projects - #8 most used programming language
cpp
1120 projects

Projects that are alternatives of or similar to Gccx

react-lite
A simple implementation of react
Stars: ✭ 51 (-78.21%)
Mutual labels:  virtual-dom, jsx
Muve
Muve is a micro library for building interactive javascript applications.
Stars: ✭ 11 (-95.3%)
Mutual labels:  virtual-dom, jsx
Vidom
Library to build UI based on virtual DOM
Stars: ✭ 408 (+74.36%)
Mutual labels:  virtual-dom, jsx
Ng Vdom
(Developer Preview) A virtual-DOM extension for Angular, also work as React bridge.
Stars: ✭ 249 (+6.41%)
Mutual labels:  virtual-dom, jsx
Redux React Starter
DEPRECATED use the new https://github.com/didierfranc/react-webpack-4
Stars: ✭ 137 (-41.45%)
Mutual labels:  virtual-dom, jsx
tung
A javascript library for rendering html
Stars: ✭ 29 (-87.61%)
Mutual labels:  virtual-dom, jsx
Htm
Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
Stars: ✭ 7,299 (+3019.23%)
Mutual labels:  virtual-dom, jsx
core
Server side rendering with The Elm Architecture in Deno
Stars: ✭ 16 (-93.16%)
Mutual labels:  virtual-dom, jsx
Cascade
A modern library for creating user interfaces.
Stars: ✭ 50 (-78.63%)
Mutual labels:  virtual-dom, jsx
Wonders
🌈 Declarative JavaScript framework to build command-line applications.
Stars: ✭ 34 (-85.47%)
Mutual labels:  virtual-dom, jsx
Vhtml
Render JSX/Hyperscript to HTML strings, without VDOM 🌈
Stars: ✭ 556 (+137.61%)
Mutual labels:  virtual-dom, jsx
Gantt
Gantt chart library using jsx support SVG, Canvas and SSR
Stars: ✭ 148 (-36.75%)
Mutual labels:  virtual-dom, jsx
Preact
⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
Stars: ✭ 30,527 (+12945.73%)
Mutual labels:  virtual-dom, jsx
Virtual Dom
关于Vue,React,Preact和Omi等框架源码的解读
Stars: ✭ 139 (-40.6%)
Mutual labels:  virtual-dom, jsx
Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+5093.59%)
Mutual labels:  virtual-dom, jsx
Crank
Write JSX-driven components with functions, promises and generators.
Stars: ✭ 2,487 (+962.82%)
Mutual labels:  jsx
React Sigma
Lightweight React library for drawing network graphs built on top of SigmaJS
Stars: ✭ 217 (-7.26%)
Mutual labels:  jsx
Svg Patterns
SVG patterns for Data Visualization.
Stars: ✭ 201 (-14.1%)
Mutual labels:  virtual-dom
Jsxobj
Build JSON using JSX 🌈 (may contain blood magic)
Stars: ✭ 200 (-14.53%)
Mutual labels:  jsx
Webapp
The react-based community network for amFOSS members
Stars: ✭ 226 (-3.42%)
Mutual labels:  jsx

gccx

Build Status npm version npm downloads MIT

Transforms CPX (JSX like syntax) into asm-dom Virtual DOM

Preview

Motivation

asm-dom Virtual DOM is a little bit verbose to write, we need a lot, not to much readable, lines of code to create a view. In addition we have to convert some types, merge attributes, props and do other stuff like that every time. For this reason we have decided to create gccx, a parser that allows us to write a new simple syntax. We will call this syntax CPX, it is based on JSX but it has some differences. Basically gccx will transform this syntax into standard C++. In this way we can write files that appear very similar to HTML and can be written and read easily.

Installation

You can install gccx using npm:

npm install --save-dev gccx

or, if you prefer, you can install gccx globally with:

npm install -g gccx

Usage

Once you have installed gccx, you can use it from the command line or from javascript. Here is an example of both:

gccx src --output dist --watch

supposing a CommonJS environment, you can import gccx in this way and immediately use it with no configuration.

import gccx from 'gccx';

const code = `
  #include "../asm-dom/asm-dom.hpp"
  #include <emscripten/val.h>
  #include <string>

  using namespace asmdom;

  int main() {
    VNode* vnode = <h1>Hello world!</h1>;

    patch(
      emscripten::val::global("document").call<emscripten::val>(
        "getElementById",
        std::string("root")
      ),
      vnode
    );

    return 0;
  };
`;

const compiled = gccx.parse(code); // compiled code as string

Documentation

Visit docs folder to find the complete doc of gccx.

Examples

Examples are available in the examples folder. You will find examples of both, cli and javascript api usage.

If you want to see a complete example that uses gccx, you can check out here the TODOMVC.

Change Log

This project adheres to Semantic Versioning.
Every release, along with the migration instructions, is documented on the Github Releases page.

Authors

Matteo Basso

Copyright and License

Copyright (c) 2017, Matteo Basso.

gccx source code is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].