TypeScript Icon

TypeScript

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
21 Stories
All Topics

React github.com

200 bytes to never think about React state management libraries ever again

Gotta love when a library is so small that Logbot can JIT inline it in the News and save us precious clicks… import React from "react" export interface ContainerProviderProps { children: React.ReactNode } export interface Container<Value> { Provider: React.ComponentType<ContainerProviderProps> useContainer: () => Value } export function createContainer<Value>(useHook: () => Value): Container<Value> { let Context = React.createContext<Value | null>(null) function Provider(props: ContainerProviderProps) { let value = useHook() return <Context.Provider value={value}>{props.children}</Context.Provider> } function useContainer(): Value { let value = React.useContext(Context) if (value === null) { throw new Error("Component must be wrapped with <Container.Provider>") } return value } return { Provider, useContainer } } export function useContainer<Value>(container: Container<Value>): Value { return container.useContainer() }

read more

TypeScript github.com

Zero-config CLI for TypeScript package development

Despite all the recent hype, setting up a new TypeScript (x React) library can be tough. Between Rollup, Jest, tsconfig, Yarn resolutions, TSLint, and getting VSCode to play nicely….there is just a whole lot of stuff to do (and things to screw up). TSDX is a zero-config CLI that helps you develop, test, and publish modern TypeScript packages with ease–so you can focus on your awesome new library and not waste another afternoon on the configuration.

read more

Shlomo Kraus github.com

Mockshot – automatic mock generation from snapshot tests

We made a silly joke on Twitter yesterday (this is what Twitter is for, no?) about test doubles and that unfortunate moment when they inevitably surprise you. This prompted Shlomo Kraus to reach out and tell us about Mockshot. In brief: Imagine you could: Never manually write a mock again Have a guarantee that your mocks are always valid Sounds nice! It works by using Jest’s snapshot tests output to generate mocks to be used in other tests. This is purposeful coupling, which seems like it could backfire in the long-run. However, the team behind the library has been using it for over a year and are still singing its praises. For more on their experience creating and using it, read this.

read more

Julian Tellez github.com

Lambcycle – a declarative lambda middleware with life cycle hooks

Lambcycle is a middleware for lambda functions. It defines a configurable life-cycle and allows you to focus on your application’s logic. It has a “Feature as Plugin” approach, so you can easily create your own plugins or reuse your favorite packages with very little effort 🐑 🛵. The author goes deep on why Lambcycle solves a serious problem over on Medium.

read more

Kent C. Dodds Medium

Every new web app at PayPal begins with TypeScript (here's why)

Kent C. Dodds shares the backstory of paypal-scripts, a tool that encapsulates all the tools common to PayPal applications and published modules and why TypeScript was a fit. Kent took a poll in their #paypal-scripts Slack channel and 100% of respondents said they wanted the change. Here’s what happened next… About a week later, I had totally migrated paypal-scripts from supporting Flow to supporting TypeScript (most of that time was making all the tools recognize .ts and .tsx files 🙄 and allowing paypal-scripts to dogfood itself which is kinda tricky 🐶). … Then we had Christmas break 🎄 and the week we got back after the new year 🎆, it was merged and now every new project starts off with modern tools that will stay updated by default and will be statically typed with TypeScript.

read more

Terminal eugeny.github.io

"A terminal for a more modern age"

I put Terminus’ tagline in scare quotes because while it’s intriguing, I do not know for sure whether it delivers on that promise. In more of its own words, Terminus is: …heavily inspired by Hyper. It is, however, designed for people who need to get things done. Them sound like fighting words. But what does “designed for people who need to get things done” mean, exactly? From the feature list in the README, I think maybe it means that it takes Windows more seriously than Hyper and handles printing output more quickly. But that’s just a guess… I’d love to see a roundup and comparison of this new breed of Electron-based terminals. Anybody game?

read more

Leo Farias github.com

NearDB - a simple document db made for globally distributed reads

The motivation behind NearDB: While working on building edge applications for higher performance and lower latency there is a need store persistent data also on edge. There are multiple distributed database solutions but they are very involved and costly while having a much lower global footprint than a CDN. The idea came up to leverage ubiquitous and mature infrastructure like cloud storage and CDNs to deliver a persistent data solution from the edge.

read more

Kelly github.com

A boilerplate web app to build your own SaaS product

You can use this web app as a boilerplate for building your own SaaS product. The app has many common SaaS features, so you can focus on the features that differentiate your product. As with most boilerplates, this is opinionated about its stack, which features: React, Material-UI, Next, MobX, Express, Mongoose, MongoDB, Typescript Here’s the full list of features and the live demo.

read more

TypeScript github.com

A secure TypeScript runtime on V8

If you need a JS runtime that supports TypeScript out of the box and has security as a top-most priority, star this repo and come back when it’s no longer “Segfaulty”. Feature bullets! 👇 No package.json, no npm. Not backwards compatible with Node Single executable Defaults to read-only file system access Always dies on uncaught errors Supports top-level await EDIT: it’s worth noting that this project is by Ryan Dahl, inventor of Node.js.

read more

0:00 / 0:00