
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@simpozio/split-test
Advanced tools
React component for A/B-testing of components.
npm i @simpozio/split-test
import SplitTest from '@simpozio/split-test';
const Component = () => {
return (
<SplitTest>
<SplitTest.Variant name="A">
Variant A
</SplitTest.Variant>
<SplitTest.Variant name="B">
Variant B
</SplitTest.Variant>
</SplitTest>
)
}
import SplitTest, {locationStateReducer} from '@simpozio/split-test';
const Component = () => {
return (
<SplitTest stateReducer={locationStateReducer}>
<SplitTest.Variant name="A">
Variant A
</SplitTest.Variant>
<SplitTest.Variant name="B">
Variant B
</SplitTest.Variant>
</SplitTest>
)
}
import SplitTest, {locationStateReducer} from '@simpozio/split-test';
const Component = () => {
const [variant, setVariant] = useState('A');
const customStateReducer = () => variant;
const handleChange = () => setVariant(variant === 'A' ? 'B' : 'A');
return (
<>
<button onClick={handleChange}>Change variant</button>
<SplitTest stateReducer={customStateReducer}>
<SplitTest.Variant name="A">
Variant A
</SplitTest.Variant>
<SplitTest.Variant name="B">
Variant B
</SplitTest.Variant>
</SplitTest>
</>
)
}
SplitTest
component accepts only one optional property:
stateReducer: (variants: string[]) => string
- state reducer is a function that controls logic of changing between variants, it accepts all variants as prop and returns single variant that should be rendered;SplitTest
component will ignore all children except SplitTest.Variant
SplitTest.Variant
component accepts prop:
name: string
- it neccessary for identifying variants inside the SplitTest component and stateReducersrandomStateReducer
- default state reducer, it will render random variant on page update;locationStateReducer
- render variant based on location query parameter 'variant', e.g. '?variant=B' for rendering variant B;FAQs
Component for A/B testing of new features and components
The npm package @simpozio/split-test receives a total of 2 weekly downloads. As such, @simpozio/split-test popularity was classified as not popular.
We found that @simpozio/split-test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.