babel-plugin-transform-react-jsx
Advanced tools
Comparing version 7.0.0-alpha.15 to 7.0.0-alpha.16
@@ -7,5 +7,3 @@ "use strict"; | ||
var t = _ref.types; | ||
var JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/; | ||
var visitor = (0, _babelHelperBuilderReactJsx2.default)({ | ||
@@ -15,2 +13,3 @@ pre: function pre(state) { | ||
var args = state.args; | ||
if (t.react.isCompatTag(tagName)) { | ||
@@ -29,22 +28,12 @@ args.push(t.stringLiteral(tagName)); | ||
var file = state.file; | ||
var id = state.opts.pragma || "React.createElement"; | ||
var _arr = file.ast.comments; | ||
for (var _iterator = file.ast.comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref2; | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
var comment = _arr[_i]; | ||
var matches = JSX_ANNOTATION_REGEX.exec(comment.value); | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref2 = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref2 = _i.value; | ||
} | ||
var comment = _ref2; | ||
var matches = JSX_ANNOTATION_REGEX.exec(comment.value); | ||
if (matches) { | ||
id = matches[1]; | ||
if (id === "React.DOM") { | ||
@@ -67,2 +56,8 @@ throw file.buildCodeFrameError(comment, "The @jsx React.DOM pragma has been deprecated as of React 0.12"); | ||
visitor.JSXAttribute = function (path) { | ||
if (t.isJSXElement(path.node.value)) { | ||
path.node.value = t.jSXExpressionContainer(path.node.value); | ||
} | ||
}; | ||
return { | ||
@@ -69,0 +64,0 @@ inherits: _babelPluginSyntaxJsx2.default, |
{ | ||
"name": "babel-plugin-transform-react-jsx", | ||
"version": "7.0.0-alpha.15", | ||
"version": "7.0.0-alpha.16", | ||
"description": "Turn JSX into React function calls", | ||
@@ -12,8 +12,8 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx", | ||
"dependencies": { | ||
"babel-helper-builder-react-jsx": "7.0.0-alpha.15", | ||
"babel-plugin-syntax-jsx": "7.0.0-alpha.15" | ||
"babel-helper-builder-react-jsx": "7.0.0-alpha.16", | ||
"babel-plugin-syntax-jsx": "7.0.0-alpha.16" | ||
}, | ||
"devDependencies": { | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.15" | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.16" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4418
57
+ Addedbabel-helper-builder-react-jsx@7.0.0-alpha.16(transitive)
+ Addedbabel-plugin-syntax-jsx@7.0.0-alpha.16(transitive)
+ Addedbabel-types@7.0.0-alpha.16(transitive)
+ Addedto-fast-properties@2.0.0(transitive)
- Removedbabel-helper-builder-react-jsx@7.0.0-alpha.15(transitive)
- Removedbabel-plugin-syntax-jsx@7.0.0-alpha.15(transitive)
- Removedbabel-types@7.0.0-alpha.15(transitive)
- Removedto-fast-properties@1.0.3(transitive)