
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
mithril-toolset
Advanced tools
Mithril toolset is a collection of utils and extensions I've written to the amazing Mithril UI library.
It's better when I demonstrate it:
// Destructuring to get the elements we need
const { elements: { html, head, body, h1, h2, div, p } } = require("mithril-toolset");
// fancy serverside rendering for an example
const render = require("mithril-node-render");
render(
html(
head(),
body(
div.container( // "container" is automatically a class!
div["#main"]( // "main" is an ID, but you can put in CSS selectors here like "#main.header"
h1("A neat heading"),
h2("A subheading"),
p("Should I also do some Lorem Ipsum?")))))
).then(console.log);
If you want to use optional classes, mithril-toolset 0.4 adds support for a maybe
.
const { maybe, elements: { div } } = require("mithril-toolset");
const component = hidden =>
div[maybe(hidden && ".hide")](
"If hidden is truthy, the class 'hide' is added to this div"))));
Attempting to use an empty selector returns the same component (although a copy to avoid reference sharing).
div[""] // identical to div
div[""] === div[""] // false. Every invocation creates a new reference, similar to Symbol
mithril-toolset
has full TypeScript support. Even if you don't use TS, it helps with VSCode's IntelliSense.
mithril-toolset
, like mithril itself, does not require any transpilation. Unlike JSX, t's fully valid JavaScript that you can use in runtime directly. You can pass these functions around, you can split them into components, or whatever it is that you do with regular functions.
More stuff will make it to this toolset as they come along. Have fun Mithril-ing!
FAQs
A toolset of Mithril tools and helpers
We found that mithril-toolset 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.