Coder Social home page Coder Social logo

jgowdy / asm-dom-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbasso/asm-dom-boilerplate

0.0 1.0 0.0 15 KB

A simple boilerplate to start using asm-dom without configuration.

License: MIT License

Makefile 52.30% JavaScript 12.70% HTML 5.81% CSS 10.19% C++ 19.00%

asm-dom-boilerplate's Introduction

asm-dom-boilerplate

A simple boilerplate to start using asm-dom without configuration. This includes:

  • asm-dom
  • CPX support: JSX like syntax in C++
  • parcel-bundler
  • autoprefixer

The boilerplate automatically compiles C++ code to WebAssembly and asm.js, the client will dinamically require the first if supported, the second otherwise.

Prerequisites

Please make sure to have emcc set as an environment variable and the lastest version of node to make parcel work. So, to validate the installation, please run the following commands:

node -v
npm -v
make -v
emcc -v
java -version

Getting started

Clone and install dependencies:

git clone https://github.com/mbasso/asm-dom-boilerplate.git
cd asm-dom-boilerplate
npm install # or make install

# if you are using windows, you have to make a little change to the Makefile in the root of the project, just open it and follow the instructions at the top

npm start # or make start

Then open http://localhost:1234 to see the example app. You can now edit index.cpp and rerun npm start to recompile and see the changes.

Building for Production

# just run:
make

This will compile your C++ and copy your index.html to the dist folder which you can deploy.

Makefile

By default the boilerplate preprocess the .cpp files in the src folder with gccx and automatically includes them when compiling. If you want to include external dependencies or add some C flags, you can modify the Makefile in the root of the project.

CSS

Parcel uses PostCSS plugins to manage CSS assets. The boilerplate includes autoprefixer for vendor prefixing, you can find and modify the PostCSS setup in .postcssrc.

Authors

Matteo Basso

Copyright and License

Copyright (c) 2018, Matteo Basso.

asm-dom-boilerplate source code is licensed under the MIT License.

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.