Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-react-transform

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-transform - npm Package Compare versions

Comparing version 2.0.0-beta1 to 2.0.0

test/fixtures/code-react-create-class-with-string-literal-display-name/.babelrc

10

lib/index.js

@@ -225,3 +225,11 @@ 'use strict';

return t.objectProperty(t.identifier(componentId), t.objectExpression(componentProps));
var objectKey = undefined;
if (t.isValidIdentifier(componentId)) {
objectKey = t.identifier(componentId);
} else {
objectKey = t.stringLiteral(componentId);
}
return t.objectProperty(objectKey, t.objectExpression(componentProps));
});

@@ -228,0 +236,0 @@

2

package.json
{
"name": "babel-plugin-react-transform",
"version": "2.0.0-beta1",
"version": "2.0.0",
"description": "Babel plugin to instrument React components with custom transforms",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -0,4 +1,9 @@

> These docs are for the v2 release using Babel 6, if you are still on Babel 5 then you should use
> v1.1 instead.
>
> View the `v1.1` docs [here](https://github.com/gaearon/babel-plugin-react-transform/tree/v1.1.1)
# babel-plugin-react-transform
[![react-transform channel on slack](https://img.shields.io/badge/slack-react--transform%40reactiflux-61DAFB.svg?style=flat-square)](http://www.reactiflux.com)
[![react-transform channel on discord](https://img.shields.io/badge/discord-react--transform%40reactiflux-61DAFB.svg?style=flat-square)](http://www.reactiflux.com)

@@ -95,3 +100,3 @@ :rocket: **Now with [Babel 6](https://github.com/babel/babel) support** (thank you [@thejameskyle](https://github.com/thejameskyle)!)

Note that when using `React.createClass()` and allowing `babel` to extract the `displayName` property you must ensure that [babel-plugin-react-display-name](https://github.com/babel/babel/tree/development/packages/babel-plugin-react-display-name) is included before `react-transform`. See [this github issue](https://github.com/gaearon/babel-plugin-react-transform/issues/19) for more details.
Note that when using `React.createClass()` and allowing `babel` to extract the `displayName` property you must ensure that [babel-plugin-react-display-name](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name) is included before `react-transform`. See [this github issue](https://github.com/gaearon/babel-plugin-react-transform/issues/19) for more details.

@@ -98,0 +103,0 @@ You may optionally specify an array of strings called `factoryMethods` if you want the plugin to look for components created with a factory method other than `React.createClass`. Note that you don’t have to do anything special to look for ES6 components—`factoryMethods` is only relevant if you use factory methods akin to `React.createClass`.

@@ -16,5 +16,10 @@ import path from 'path';

const fixtureDir = path.join(fixturesDir, caseName);
const actualPath = path.join(fixtureDir, 'actual.js');
let actualPath = path.join(fixtureDir, 'actual.js');
const actual = transformFileSync(actualPath).code;
if (path.sep === '\\') {
// Specific case of windows, transformFileSync return code with '/'
actualPath = actualPath.replace(/\\/g, '/');
}
const expected = fs.readFileSync(

@@ -21,0 +26,0 @@ path.join(fixtureDir, 'expected.js')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc