This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro __rejectAwait { | |
case { _ $body ... } => { | |
letstx $await = [makeIdent('await', #{$body ...}[0])]; | |
return #{ | |
macro $await { | |
case { $name:ident $e:expr } => { | |
throwSyntaxError('await', 'cannot use await keyword outside of async function', #{$name}); | |
} | |
} | |
$body ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro emitQuery { | |
case { _ $id:ident } => { | |
letstx $name = [makeValue(#{$id}[0].token.value, #{$id})]; | |
letstx $registry = [makeIdent('registry', #{$id})]; | |
return #{ var $id = $registry.query($name) } | |
} | |
} | |
macro inject { | |
case { _ $id:ident (,) ... { $body ...} } => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var theme = require('my-theme'); | |
module.exports = style { | |
background-color: {theme.bgColor}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "./theme" as theme | |
.Component { | |
.Child { | |
width: var(theme.width); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function condition(props) { | |
return props.if ? Array.prototype.slice.call(arguments, 1) : []; | |
} | |
var Component = React.createClass({ | |
render: function() { | |
return ( | |
<div> | |
<condition if={this.state.show}> | |
True! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro replace { | |
case { _ $a:expr $b:expr { $first $rest ... } } => { | |
if ($a.token.value === $first.token.value) { | |
return #{ $b replace $a $b $rest ... } | |
} else { | |
return #{ $first replace $a $b { $rest ... } } | |
} | |
} | |
case { _ $a:expr $b:expr { } } => { | |
return []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Stylesheets() { | |
var registry = requireAssets.currentRegistry(); | |
var stylesheets = []; | |
for (var url in registry.urlToFilename) | |
if (/\.css$/.exec(url)) | |
stylesheets.push(<link rel="stylesheet" key={url} href={url} />); | |
return stylesheets; | |
} | |
var App = React.createClass({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: Some new title | |
... | |
# some new stuff | |
And now some text is here | |
Another test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @jsx React.DOM | |
*/ | |
var jsx = ( | |
React.DOM.div(null, | |
" Hello, " , | |
React.DOM.a(null, "world!") | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Router = require('react-router-component'); | |
var Link = Router.Link; | |
var Locations = Router.Locations; | |
var Location = Router.Location; | |
var plugins = [ | |
{title: 'Reports', path: '/reports', handler: ReportHandler}, | |
... | |
]; |
OlderNewer