Today’s issue: Evan You gets some bread, visualizing your (Zod) issues, and live betting on ViteConf.
Welcome to #328.
Me after investing my life savings into an obscure TypeScript library
If you offered me 10 million dollars, I couldn’t tell you what Bloomberg does. But whatever it is, I’m guessing that static typing is very important because their developers have been launching some really cool TypeScript-flavored OSS lately.
We highlighted ts-blank-space last month, a fast type-stripping compiler that converts TS to JS. And they just launched Stricli earlier this week, a framework for building complex CLIs with type safety and zero dependencies.
Why do we need another CLI framework? Michael Molisani (the project’s maintainer) wrote about how existing frameworks like oclif and clipanion do offer full type safety, but they can also introduce additional dependencies and complexity that aren’t necessary for many use cases.
So he and his team built Stricli to give them all the features they wanted, without any extra overhead:
Full TypeScript support – including types for named flags and positional arguments that are defined once and flow through the entire app.
Dual support for ESM and CommonJS – plus easy code splitting with ESM build tools and dynamic autocomplete.
Zero runtime dependencies – plus support for optional dependency injection, because all system access is encapsulated in a single context object.
The tradeoff here is that Stricli was purposefully designed with a more limited scope, so you’ll need to add other packages if you want interactive user prompts, terminal output styling, and other features.
Bottom Line: If I had known that open-source TypeScript projects were the secret behind Michael Bloomberg’s $100 billion fortune, I would’ve pledged my allegiance to the Type Nerd Mafia way sooner.
Me watching bots flood my email form with infinite variations of bigbuttz99@hotmail.com
It gives you native security for Bun, Next.js, Deno, Node.js and every other modern platform – so you can easily implement rate limiting, bot protection, email validation, and protection from common attacks.
“bUt hOw iS tHIs diFFeReNt fRoM oTheR sEcURitY tOOLs?” Arcjet is *actually* unique because of 3 core principles:
Proper security needs the full context of the application – so your security rules are located alongside the code they’re protecting (see live example).
Security rules should be easy to test in dev and prod – so you can run Arcjet locally, in staging, and in production.
Security shouldn’t interfere with the rest of your app – so Arcjet is easy to install, doesn’t add latency, and doesn’t require any re-architecting.
Use it for free on your personal projects – and see how easy it is to get enterprise-quality security.
One of their engineers wrote this 2,800-word DEEP dive that compares Next-gen JS runtimes & package managers to their predecessors, so you can make the best choice for your next project.
const products = [
{ name: 'Grapes', price: 2 },
{ name: 'Banana', price: 1 },
{ name: 'Apple', price: 3 },
{ name: 'Cherry', price: 2 },
{ name: 'Date', price: 1 }
];
products.sort((a, b) => a.price > b.price);
ViteConf is live and happening right now if you want to tune in. I tried using FanDuel to live-bet on how many times the speakers would say “blazing”, but I think that integration is broken.
Amelia Wattenberger wrote a beautifully visual article on bridging the gap between the hard logic of machines and the soft logic of humans with your UI.
Zod.fyi lets you visualize the issues in a ZodError
. The last time my therapist told me to “visualize my issues,” I didn’t go outside for three days, so hopefully this experience will be more helpful.
Here’s an early New Year’s resolution – stop wasting your time on manual tests and get QA Wolf to give you a personalized demo of how they can help your team achieve 80% automated test coverage and ship 5x faster. They’ve done that for hundreds of companies like Salesloft, Drata, and Autotrader, so you’ll definitely be in good hands. [sponsored]
ESLint now officially supports linting JSON and Markdown.
Devon Govett gave a great talk on the past, present, and future of JavaScript bundlers.
Eleventy v3.0 was released full ESM support, async configuration, new Deno support, and more.
Datadog’s team created this Front-end Developer Kit with a bunch of free resources to help you better understand user activity and troubleshoot front-end issues before you crash prod, ideally. [sponsored]
Tauri 2.0 comes with hot module replacement, a more advanced plugin system, and some noticeable DX improvements.
Vite just launched a company called VoidZero and raised $4.6m from investors. You might not love the idea of VC-funded open source, but it’s probably more sustainable than Evan You releasing a wallpaper app with a bunch of high-res photos of the Vite maintainers that costs $13.99/month.
When using the Array.sort
method, the compare function should return a number, not a boolean. Returning a negative number will sort the first item before the second, a positive number will sort the second item before the first, and returning 0 will leave the items in the same order.
const products = [
{ name: 'Grapes', price: 2 },
{ name: 'Banana', price: 1 },
{ name: 'Apple', price: 3 },
{ name: 'Cherry', price: 2 },
{ name: 'Date', price: 1 }
];
products.sort((a, b) => a.price - b.price);