
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@ryanclark/swc-plugin-jsx-marker
Advanced tools
SWC plugin for adding attributes to design system components
A simple SWC plugin that adds a data-uic attribute to JSX elements from a specified library. When using a design
system library like Chakra UI, this plugin can help you identify the components in the DOM for easier debugging and
testing. This works similarly to how the Emotion SWC plugin adds the name of the component to the class name. This
plugin was adapted from the Emotion SWC plugin.
npm install @ryanclark/swc-plugin-jsx-marker --save-dev
pnpm add @ryanclark/swc-plugin-jsx-marker -D
Add the plugin to your SWC configuration. Here's an example using Vite with the @vitejs/plugin-react-swc plugin:
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
const config = defineConfig(({mode}) => ({
plugins: react({
plugins: [
[
'@ryanclark/swc-plugin-jsx-marker',
{
libraryName: '@example/design-system', // defaults to '@chakra-ui/react' if not specified
enabled: mode !== 'production', // defaults to true if not specified
// attributeName: 'data-testid', // defaults to 'data-uic' if not specified
},
],
],
}),
}));
export { config as default };
This plugin should come first in the list of plugins to ensure it runs before other transformations. It only adds the
data-uic attribute to the JSX elements, so it needs to run before any other plugins that might modify the JSX.
This will transform this:
import { chakra, Box, Button, HStack } from '@chakra-ui/react';
const Item = chakra(Box)({
baseStyle: {
padding: '8px',
border: '1px solid black',
},
});
const StyledItem = styled(Item, {
baseStyle: {
padding: '16px',
border: '1px solid red',
},
});
function Example() {
return (
<HStack>
<Item>
<Button>Click me</Button>
</Item>
<StyledItem>
<Button>Click me</Button>
</StyledItem>
</HStack>
)
}
into:
import { chakra, Box, Button, HStack } from '@chakra-ui/react';
const Item = chakra(Box, {
baseStyle: {
padding: '8px',
border: '1px solid black',
},
});
const StyledItem = styled(Item, {
baseStyle: {
padding: '16px',
border: '1px solid red',
},
});
function Example() {
return (
<HStack data-uic="Example-HStack">
<Item data-uic="Example-Item-Box">
<Button>Click me</Button>
</Item>
<StyledItem data-uic="Example-StyledItem-Item">
<Button>Click me</Button>
</StyledItem>
</HStack>
)
}
The plugin accepts the following configuration options:
| Option | Type | Default | Description |
|---|---|---|---|
libraryName | string | '@chakra-ui/react' | The name of the library whose components should be marked |
enabled | boolean | true | Whether the plugin is enabled |
attributeName | string | 'data-uic' | The attribute name to add to the JSX elements |
FAQs
SWC plugin for adding attributes to design system components
We found that @ryanclark/swc-plugin-jsx-marker 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.
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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.