Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
GrainJS is a Javascript (and TypeScript) library for building highly performant dynamic applications.
GrainJS provides convenient pure-JS interfaces for building DOM. It has observables inspired by Knockout to create declarative data models and tie them to UI. It includes light-weight event dispatching, DOM event subscriptions, disposable components, and in-code CSS styling.
GrainJS is in part inspired by React, but based on observables instead of virtual dom, and with a convenient way to build DOM without JSX. It is lighter weight, and has less magic happening under the covers.
The focus is on performance and conciseness. The library has no dependencies and is only 31K. minified.
npm install --save grainjs
const name = observable("");
dom.update(document.body,
dom('input', {type: 'text', placeholder: 'Enter your name'},
dom.on('input', (ev, elem) => name.set(elem.value)),
),
dom('div', 'Hello, ',
dom.text((use) => use(name).toUpperCase() || 'Stranger'),
'!',
),
);
At a basic level, GrainJS allows you to describe DOM structure in one place, using Javascript (or TypeScript), and to keep the dynamic aspects of it separated into variables called "observables". These observables serve as the model of the UI; other code can update them to cause UI to update, without knowing the details of the DOM construction.
In addition, the library provides approaches to create and dispose resources (important for long-lived single-page applications), and an assortment of other related tools.
FAQs
JS library from Grist Labs
The npm package grainjs receives a total of 215 weekly downloads. As such, grainjs popularity was classified as not popular.
We found that grainjs 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.