Giter VIP home page Giter VIP logo

reagent-nodejs's Introduction

reagent-nodejs

Isomorphic reagent app with both server and client side rendering.

Note: This code is very alpha, use at your own risk.

Initial rendering happens with reagent on the server side in node, subsequent action render through reagent in the browser.

Prerequisites

  • Java 7 or better
  • NodeJS - assumes the binary is named node

Quick Start

Starts a web server on port 3000 with reagent rendering on the server side.

export DOCROOT="$(pwd)/target/dev"
infra/lein cljsbuild once dev node
infra/lein nodejs

How It Works

On the server side, reagent-nodejs uses node along with express to server content. There were a couple of shims required to make it work:

  • closure requires downloading the nodejs.js bootstrap code from the closure-library
  • a copy of react.js needs to be present in the server's root directory
  • javascript stubs - window.attachEvent, document.attachEvent, and XMLHttpRequest
  • React var needs to be defined with the contents of react library

To Do

  • Update to work with advanced mode compilation
  • Figure out how Clojure shell out can write to stdout. Currently, infra/lein nodejs doesn't print anything

reagent-nodejs's People

Contributors

savaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

carlosvega20

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.