mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
merge of nippur72 changes regarding rt-virtual
This commit is contained in:
commit
63ef4541ae
@ -32,8 +32,8 @@
|
|||||||
"chalk": "^1.1.1",
|
"chalk": "^1.1.1",
|
||||||
"cheerio": "^0.19.0",
|
"cheerio": "^0.19.0",
|
||||||
"css": "^2.2.1",
|
"css": "^2.2.1",
|
||||||
"escodegen": "1.7.1",
|
"escodegen": "^1.8.0",
|
||||||
"esprima-fb": "^15001.1001.0-dev-harmony-fb",
|
"esprima": "^2.7.1",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^3.10.1",
|
||||||
"optionator": "^0.8.0",
|
"optionator": "^0.8.0",
|
||||||
"text-table": "^0.2.0"
|
"text-table": "^0.2.0"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var cheerio = require('cheerio');
|
var cheerio = require('cheerio');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var esprima = require('esprima-fb');
|
var esprima = require('esprima');
|
||||||
var escodegen = require('escodegen');
|
var escodegen = require('escodegen');
|
||||||
var reactDOMSupport = require('./reactDOMSupport');
|
var reactDOMSupport = require('./reactDOMSupport');
|
||||||
var reactNativeSupport = require('./reactNativeSupport');
|
var reactNativeSupport = require('./reactNativeSupport');
|
||||||
@ -347,7 +347,7 @@ function convertHtmlToReact(node, context) {
|
|||||||
data.item = arr[0].trim();
|
data.item = arr[0].trim();
|
||||||
data.collection = arr[1].trim();
|
data.collection = arr[1].trim();
|
||||||
validateJS(data.item, node, context);
|
validateJS(data.item, node, context);
|
||||||
validateJS(data.collection, node, context);
|
validateJS("(" + data.collection + ")", node, context);
|
||||||
stringUtils.addIfMissing(context.boundParams, data.item);
|
stringUtils.addIfMissing(context.boundParams, data.item);
|
||||||
stringUtils.addIfMissing(context.boundParams, `${data.item}Index`);
|
stringUtils.addIfMissing(context.boundParams, `${data.item}Index`);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var esprima = require('esprima-fb');
|
var esprima = require('esprima');
|
||||||
var rtError = require('./RTCodeError');
|
var rtError = require('./RTCodeError');
|
||||||
var RTCodeError = rtError.RTCodeError;
|
var RTCodeError = rtError.RTCodeError;
|
||||||
|
|
||||||
|
@ -2,4 +2,4 @@ import React from 'react/addons';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
export default function () {
|
export default function () {
|
||||||
return React.createElement('div', {});
|
return React.createElement('div', {});
|
||||||
};
|
}
|
5
test/data/repeat-literal-collection.rt
Normal file
5
test/data/repeat-literal-collection.rt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<div>
|
||||||
|
<div rt-repeat="items in {a:1, b:2}">
|
||||||
|
{items}
|
||||||
|
</div>
|
||||||
|
</div>
|
1
test/data/repeat-literal-collection.rt.html
Normal file
1
test/data/repeat-literal-collection.rt.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<div><div>1</div><div>2</div></div>
|
@ -183,10 +183,28 @@ test('convert jsrt and test source results', function (t) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('html tests', function (t) {
|
test('html tests', function (t) {
|
||||||
var files = ['scope.rt', 'scope-trailing-semicolon.rt', 'scope-variable-references.rt', 'lambda.rt', 'eval.rt', 'props.rt', 'custom-element.rt', 'style.rt', 'concat.rt',
|
var files = [
|
||||||
'js-in-attr.rt', 'props-class.rt', 'rt-class.rt', 'className.rt', 'svg.rt', 'virtual.rt',
|
"scope.rt",
|
||||||
'scope-evaluated-after-repeat.rt', 'scope-evaluated-after-repeat2.rt', 'scope-evaluated-after-if.rt', 'scope-obj.rt'
|
"scope-trailing-semicolon.rt",
|
||||||
];
|
"scope-variable-references.rt",
|
||||||
|
"lambda.rt",
|
||||||
|
"eval.rt",
|
||||||
|
"props.rt",
|
||||||
|
"custom-element.rt",
|
||||||
|
"style.rt",
|
||||||
|
"concat.rt",
|
||||||
|
"js-in-attr.rt",
|
||||||
|
"props-class.rt",
|
||||||
|
"rt-class.rt",
|
||||||
|
"className.rt",
|
||||||
|
"svg.rt",
|
||||||
|
"virtual.rt",
|
||||||
|
"scope-evaluated-after-repeat.rt",
|
||||||
|
"scope-evaluated-after-repeat2.rt",
|
||||||
|
"scope-evaluated-after-if.rt",
|
||||||
|
"scope-obj.rt",
|
||||||
|
"repeat-literal-collection.rt"
|
||||||
|
];
|
||||||
t.plan(files.length);
|
t.plan(files.length);
|
||||||
|
|
||||||
files.forEach(check);
|
files.forEach(check);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user