Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
gulp-react-jade-include
Advanced tools
options
: apply any JADE optionsLet us have such welcome.jade
file
.welcome-back
.greating Welcome back {this.props.title}
.avatar
img.img-circle(alt="{this.props.title}" src="{this.props.avatar}")
The following gulp snippet
var react = require('gulp-react'),
reactJadeInclude = require('gulp-react-jade-include'),
gulp.task('renderJSXWithJADE', function(){
return stream = gulp.src("welcome.jsx")
.pipe(reactJadeInclude({
pretty: true
}))
.pipe(react())
.pipe(gulp.dest("dest"));
});
Will turn
var Welcome = React.createClass({
render: function() {
return (
<include src="welcome.jade"/>
);
}
});
React.render(
<Welcome title="Prometeus" avatar="media/avatar.jpg" />,
document.getElementById('welcome')
);
Into welcome.js
file
var Welcome = React.createClass({displayName: "Welcome",
render: function() {
return (
React.createElement("div", {class: "welcome-back"},
React.createElement("div", {class: "greating"}, "Welcome back Prometeus"),
React.createElement("div", {class: "avatar"}, React.createElement("img", {alt: "Prometeus", src: "media/avatar.jpg", class: "img-circle"}))
)
);
}
});
React.render(
React.createElement(Welcome, null),
document.getElementById('welcome')
);
Or you can skip rendering JSX to JS, so such gulp snippet
var react = require('gulp-react'),
reactJadeInclude = require('gulp-react-jade-include'),
gulp.task('renderJSXWithJADE', function(){
return stream = gulp.src("welcome.jsx")
.pipe(reactJadeInclude({
pretty: true
}))
.pipe(gulp.dest("dest"));
});
Will turn
var Welcome = React.createClass({
render: function() {
return (
<include src="welcome.jade"/>
);
}
});
React.render(
<Welcome title="Prometeus" avatar="media/avatar.jpg" />,
document.getElementById('welcome')
);
Into welcome.jsx
file
var Welcome = React.createClass({
render: function() {
return (
<div className="welcome-back">
<div className="greating">Welcome back {this.props.title}</div>
<div className="avatar">
<img alt={this.props.title} src={this.props.avatar} className="img-circle">
</div>
</div>
);
}
});
React.render(
<Welcome title="Prometeus" avatar="media/avatar.jpg" />,
document.getElementById('welcome')
);
FAQs
Compiled jade template to react via include
The npm package gulp-react-jade-include receives a total of 6 weekly downloads. As such, gulp-react-jade-include popularity was classified as not popular.
We found that gulp-react-jade-include demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.