sweet-jsx

0.2.0 • Public • Published

sweet-jsx

Use JSX and Sweet.js macros together.

WARNING: it can be used only with locally installed Sweet.js compiler or with sweetify.

This macros fences JSX syntax inside jsx-tagged template string and compiles it down to JS with respect to hygiene. So you can write JSX like that:

render: function() {
  var x = 42;
  return jsx `<div>The answer is {x}</div>`;
}

It even allows to use other macros inside interpolations:

macro plusone {
  rule { $x:expr } => { $x + 1 }
}

var dom = jsx `
  <div>{plusone 41}</div>
`

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i sweet-jsx

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • andreypopp