
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.
@chialab/dna
Advanced tools
DNA • Progressive Web Components
DNA aims to unleash the power of Custom Elements through declarative API, customized built-in elements and a shadow-free composition.
DNA makes it easy to create customized built-in elements that inherit HTML behavior, preserving usability and accessibility.
With @property
and @state
decorators, DNA adds reactivity to class fields, syncing with attributes and triggering updates on change.
DNA renders slotted content via a custom light DOM engine —no Shadow DOM— ensuring form compatibility and allowing <slot>
inside built-in elements like <button>
.
Use the @listen
decorator for delegated event handling, even for slotted content. Events can be async and dispatched from within the class.
Built with standard Web Components APIs, DNA works with any framework. Plasma can generate wrappers for React, Vue, Svelte, and Angular.
The DNA tools ecosystem includes a Storybook preset for Web Components, which automatically generates documentation and controls for your components.
Install via NPM:
npm i @chialab/dna
yarn add @chialab/dna
import { Component, customElement, listen, property } from '@chialab/dna';
@customElement('hello-world')
class HelloWorld extends Component {
// define an observed property
@property() name: string = '';
render() {
return (
<>
<input
name="firstName"
value={this.name}
/>
<h1>Hello {this.name || 'World'}!</h1>
</>
);
}
// delegate an event
@listen('change', 'input[name="firstName"]')
private onChange(event: Event, target: HTMLInputElement) {
this.name = target.value;
}
}
Then use the element in your HTML:
<hello-world></hello-world>
Install the dependencies and run the build
script:
yarn install
yarn build
This will generate the bundles in the dist
folder, as well as the declaration files.
Run the test
script:
yarn test
DNA is released under the MIT license.
FAQs
Progressive Web Components
The npm package @chialab/dna receives a total of 309 weekly downloads. As such, @chialab/dna popularity was classified as not popular.
We found that @chialab/dna demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.