
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Browserify transform for JSX (superset of JavaScript used in React library):
/**
* @jsx React.DOM
*/
var React = require('react')
var Hello = React.createClass({
render: function() {
return <div>Hello, {this.props.name}!</div>
}
})
React.renderComponent(
<Hello name="World" />,
document.getElementById('hello')
)
Save the snippet above as main.js
and then produce a bundle with the following
command:
% browserify -t reactify main.js
reactify
transform activates for files with either .jsx
extension or /** @jsx React.DOM */
pragma as a first line for any .js
file.
If you want to reactify modules with other extensions, pass an -x / --extension
option:
% browserify -t coffeeify -t [ reactify --extension coffee ] main.coffee
If you don't want to specify extension, just pass --everything
option:
% browserify -t coffeeify -t [ reactify --everything ] main.coffee
reactify
transform also can compile a limited set of es6 syntax constructs
into es5. Supported features are arrow functions, rest params, templates, object
short notation and classes. You can activate this via --es6
or --harmony
boolean option:
% browserify -t [ reactify --es6 ] main.js
You can also configure it in package.json
{
"name": "my-package",
"browserify": {
"transform": [
["reactify", {"es6": true}]
]
}
}
Reactify uses jstransform to transform JavaScript code. It allows code transformations to be pluggable and, what's more important, composable. For example JSX and es6 are implemented as separate code transformations and still can be composed together.
Reactify provides --visitors
option to specify additional jstransform visitors
which could perform additional transformations.
FAQs
Browserify transform for JSX (a superset of JS used by React.js)
We found that reactify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.