
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
generic-jsx-loader
Advanced tools
A webpack loader for custom JSX. Can be used to represent custom data as raw XML inside JavaScript code.
This is a simple wrapper for generic-jsx-tranpiler npm package
This can be used to use JSX to turn XML inside JavaScript into any type of data. For example React transforms JSX into raw JavaScript function calls React.createElement function calls (React Without JSX). This package can be used to easily transform raw XML in JavaScript (JSX) into custom data such as custom function calls, JSON, or other JS code/data.
npm install generic-jsx-transpiler
I have created a HyperScript loader
import genericJsxloader from 'generic-jsx-loader'
function serialize(component) {
// This is where you can do custom transformations on the JSX
// 'component' is a JS object with information on parsed XML
// This function should return a string containing valid javascript code
return "'JSX_REPLACEMENT'";
}
export default function loader(source) {
const options = {
serialize,
// All options are passed to generic-jsx-transpiler
// new Parser({ serializer: options });
};
return genericJsxLoader(source, options);
}
To use this generic loader in a single project add it to webpack.config.js:
module.exports = {
...
module: {
rules: [
{
test: /\.gjsx$/, //Replace this with any file extension including .js
loader: 'jsx-hyperscript-loader',
options: {
serialize: function(component) {
return "'JSX_REPLACEMENT'[";
}
}
}
]
}
}
FAQs
A webpack loader for loading custom JSX
The npm package generic-jsx-loader receives a total of 3 weekly downloads. As such, generic-jsx-loader popularity was classified as not popular.
We found that generic-jsx-loader 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.