
Security News
vlt 1.5.0 Adds Agent Skills Management
vlt 1.5.0 links skills from JavaScript dependencies to coding agents, with lockfile versioning and Socket data to filter out known malicious packages.
@axew/swc-plugin-jsx-control-statements
Advanced tools
📢: This repository is a temporary release for this PR.
📢: This repository is a temporary release for this PR.
📢: This repository is a temporary release for this PR.
Original idea: babel-plugin-jsx-control-statements
pnpm (recommended):
pnpm i -D @axew/swc-plugin-jsx-control-statements
or yarn
yarn add -D @axew/swc-plugin-jsx-control-statements
swcIn your SWC config, you have to add to jsc.experimental.plugins - ['@axew/swc-plugin-jsx-control-statements', {}], like in the following code:
jsc: {
experimental: {
plugins: [
['@axew/swc-plugin-jsx-control-statements', {}],
],
},
},
<If> tagimport React from 'react';
const Greeting = () => {
const [closed, setClosed] = useState(false);
return (
<>
<If condition={!closed}>
Hello,
</If>
World
<If condition={!closed}>
<button onClick={() => setClosed(true)}>Close</button>
</If>
</>
)
};
<Choose> tag (if - else if - else condition)import React from 'react';
const Greeting = () => {
const [closed, setClosed] = useState(false);
return (
<>
<Choose>
<When condition={!closed}>
Hello,
</When>
<Otherwise>
Bye,
</Otherwise>
</Choose>
World
<If condition={!closed}>
<button onClick={() => setClosed(true)}>Close</button>
</If>
</>
)
};
For tag (like array map function)import React from 'react';
const TodoList = ({ items }) => {
return (
<For each="item" of={items}>
<span key={item.id}>{item.title}</span>
</For>
);
};
[!WARNING] using the index as key attribute is not stable if the array changes
<For each="item" index="idx" of={[1, 2, 3]}> <span key={idx}>{item}</span> <span key={`${idx}_2`}>Static Text</span> </For>
With tagimport React from 'react';
const SomeComponent = ({ items }) => {
return (
<With foo={47} bar="test">
<span>{foo}</span>
<span>{bar}</span>
</With>
);
};
import React from 'react';
const SomeComponent = ({ items }) => {
return (
<With foo={47}>
<With bar="test">
<span>{foo}</span>
<span>{bar}</span>
</With>
</With>
);
};
FAQs
SWC plugin for jsx-control-statements
We found that @axew/swc-plugin-jsx-control-statements demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
vlt 1.5.0 links skills from JavaScript dependencies to coding agents, with lockfile versioning and Socket data to filter out known malicious packages.

Security News
Rust 1.100 will add opt-in dependency cooldowns to Cargo, giving security scanners and maintainers time to catch malicious crate releases.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.