Git Product home page Git Product logo

rave-load-jsx's Introduction

rave-load-jsx

Adds jsx file loading to rave.js based on the file extension.

By default, rave-load-jsx loads files with the .jsx extension and compiles the jsx syntax to JavaScript on the fly in the browser. It's only recommended to use this loader for development only. In production you should precompiled all of the jsx files. (How to coming soon).

Usage

First install it into your rave project via:

npm install --save rave-load-jsx

For CommonJS/node-formatted modules (or AMD-wrapped CommonJS):

var MyComponent = require('./my_component.jsx');
// ...
React.renderComponent(<MyComponent />, document.body);

For classic AMD modules:

define(['./my_component.jsx'], function (MyComponent) {
  // ...
  React.renderComponent(<MyComponent />, document.body);
});

For ES6-formatted modules:

import MyComponent from './my_component.jsx';
// ...
React.renderComponent(<MyComponent />, document.body);

rave-load-jsx's People

Contributors

briancavalier avatar kidkarolis avatar unscriptable avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rave-load-jsx's Issues

Should rave-node-process be a dependency?

I used rave-load-jsx today and had to install rave-node-process also, or else jsx transpiling would fail with an error (basically that process was undefined). Should rave-load-jsx list rave-node-process as a dependency? Or did I do something wrong?

FWIW, after I installed rave-node-process, it all worked perfectly ... made it really easy to create a simple demo with React :)

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.