jlongster/jsx-reader


A JSX reader for JavaScript, powered by sweet.js.

License: BSD-2-Clause

Language: JavaScript


jsx-reader

A reader to hook in JSX syntax to JavaScript, using sweet.js. Why? Because now you can use any other language extensions (macros) with JSX. All you have to do is integrate sweet.js in your pipeline and you can have everything, including working sourcemaps and nice errors across all things.

This is beta. There are likely small bugs and edge cases to be fixed. That said, it should be relatively stable.

<div>
  Monkeys:
  {listOfMonkeys} {scratchesAss}
</div>
React.DOM.div(null, 'Monkeys:', listOfMonkeys, ' ', scratchesAss);

Or

<div>
    <h1>Title</h1>
    <p>
</div>
SyntaxError: [JSX] Expected correspoding closing tag for p
5: </div>
     ^
    at Object.readtables.parserAccessor.throwSyntaxError (/Users/james/projects/jsx-
reader/node_modules/sweet.js/lib/parser.js:4947:23)                                
    at Object.JSXReader.readElement (/Users/james/projects/jsx-reader/jsx-reader.js:
223:21)                                                                            

Project Statistics

Sourcerank 8
Repository Size 198 KB
Stars 149
Forks 15
Watchers 8
Open issues 4
Dependencies 0
Contributors 1
Tags 0
Created
Last updated
Last pushed

Top Contributors See all

James Long

Packages Referencing this Repo

jsx-reader
reader
Latest release 0.1.1 - Updated - 149 stars

Something wrong with this page? Make a suggestion

Last synced: 2024-08-10 08:30:45 UTC

Login to resync this repository