サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
iPhone 16
fettblog.eu
Published on July 6, 2021 Stefan on Mastodon Reading time: 10 minutes More on TypeScript, JavaScript The Array.prototype.includes function allows searching for a value within an array. If this value is present, the function returns true! How handy! Of course, TypeScript has proper typings for this JavaScript functionality. However, in certain cases, the typings can bite a little. The reason? It’s
Published on April 13, 2021 Stefan on Mastodon Reading time: 15 minutes More on TypeScript, React If you are creating component libraries and design systems in React, you might already have fowarded Refs to the DOM elements inside your components. This is especially useful if you wrap basic components or leafs in proxy components, but want to use the ref property just like you’re used to: const Bu
Published on January 20, 2021 Stefan on Mastodon Reading time: 12 minutes More on TypeScript I write a lot about TypeScript and I enjoy the benefits it gives me in my daily work a lot. But I have a confession to make, I don’t really like writing types or type annotations. I’m really happy that TypeScript can infer so much out of my usage when writing regular JavaScript so I’m not bothered writing
Published on November 19, 2020 Stefan on Mastodon Reading time: 8 minutes More on TypeScript, JavaScript, Tidy Typescript This is the first article in a series of articles where I want to highlight ways on how to keep your TypeScript code neat and tidy. This series is heavily opinionated, so don’t be angry if I ditch a feature that you learned to like. It’s not personal. Today we look at enums. En
Published on January 7, 2021 Stefan on Mastodon Reading time: 6 minutes More on TypeScript, JavaScript, Tidy Typescript My book TypeScript in 50 Lessons features interludes. Short texts on TypeScript culture that provide room to breathe between heavy, technical tutorials. One of those interludes gives some opinionated advice on how to name generic variables. I want to recap this text piece and ela
Published on June 29, 2020 Stefan on Mastodon Reading time: 17 minutes More on TypeScript Recently, I had to convert a union type into an intersection type. Working on a helper type UnionToIntersection<T> has taught me a ton of things on conditional types and strict function types, which I want to share with you. I really like working with non-discriminated union types when I try to model a type w
Published on July 30, 2020 Stefan on Mastodon Reading time: 10 minutes More on TypeScript, React, Preact Update: React types for version 18 changed a lot! If you encounter problems described in this article, make sure you update to the latest version! In my recent article on TypeScript and React component patterns I’ve stated that I don’t use the built-in type React.FC<> but rather be explicit wit
Published on July 28, 2020 Stefan on Mastodon Reading time: 10 minutes More on TypeScript, React, Preact This list is a collection of component patterns for React when working with TypeScript. See them as an extension to the TypeScript + React Guide that deals with overall concepts and types. This list has been heavily inspired by chantastic’s original React patterns list. Contrary to chantastic’s
Published on June 17, 2020 Stefan on Mastodon Reading time: 7 minutes More on TypeScript Note: Be very careful with this technique. Better checkout my new approach. TypeScript’s predefined types in lib.d.ts are usually very well-typed and give tons of information on how to use built-in functionality as well as providing you with extra-type safety. Until they don’t. Consider the following example w
Published on June 19, 2020 Stefan on Mastodon Reading time: 12 minutes More on TypeScript TypeScript 4.0 is supposed to be released in August 2020, and one of the biggest changes in this release will be variadic tuple types. And even though his feature is hot of the press at the time of this writing, it’s worth checking out and see what we can do with it. Note that stuff here might be subject to c
Published on July 16, 2019 Stefan on Mastodon Reading time: 10 minutes More on TypeScript One way to think about TypeScript is as a thin layer around JavaScript that adds type annotations. Type annotations that make sure you don’t make any mistakes. The TypeScript team worked hard on making sure that type checking also works with regular JavaScript files. TypeScript’s compiler (tsc) as well as lan
Published on September 6, 2019 Stefan on Mastodon Reading time: 4 minutes More on TypeScript, JavaScript If you come from traditional, strongly typed languages you might be familiar with the concept of void: A type telling you that functions and methods return nothing when called. void exists in both JavaScript as an operator and in TypeScript as a primitive type. And in both worlds void works a l
Web apps are really boring if you don’t interact with them. Events are key, and TypeScript’s React typings have great support for them. In this section: Basic Event Handling Restrictive Event Handling Where’s InputEvent? Basic Event Handling # React uses its own event system. That’s why you can’t use typical MouseEvents or similar on your elements. You need to use the specific React version, other
Welcome to this little primer on TypeScript and React! A match made in heaven! Why? JSX is syntactic sugar. Every JSX element you open and pass properties through, is nothing but a function call in React (or Preact or Vue or Dojo… you name it). This gives us one big advantage in TypeScript: JavaScript can be parsed, understood and evaluated. Which means you get all the tooling and compilation bene
Hooks have been announced at React Conf 2018. Check out this page for more details. I think they’re pretty awesome. Probably game-changing! Hooks heave formerly “stateless” functional components to … basically everything traditional class components can be. With a much cleaner API! Just quickly after their release in React 16.7., React typings in DefinitelyTyped got an update as well. Check out ho
Published on March 25, 2015 Stefan on Mastodon Reading time: 8 minutes More on Gulp, Browserify, Tools With the ever-changing eco system of Node.js tools, a short version disclaimer. This article has been created using Gulp v3.8 Browserify Glob 5.0 Event Stream 3.3 Vinyl Source Stream 1.1 If something does not work when you’re using the same tutorial, please check if there’s been a major update ca
Published on April 10, 2014 Stefan on Mastodon Reading time: 4 minutes More on Tools, Sass, Gulp Update 2016/02: This is old. This might not be up to date anymore! Update 2015/03: There has been a breaking change with gulp-ruby-sass v1.0. The files have been updated. Update 2015/12: There have been some updates with gulp-sourcemaps and the way sourcemaps are treated with gulp-ruby-sass. The code s
Published on September 2, 2013 Stefan on Mastodon Reading time: 7 minutes More on Tools, Workflows, Grunt, Yeoman With Effeckt.css I discovered assemble.io, a node-based static site generator for ... well ... assembling HTML files from different parts. A tool like that was much needed by our department once we switched from an inconvenient clutter of Ant builds, PHP includes, CodeKit and command l
このページを最初にブックマークしてみませんか?
『fettblog.eu | TypeScript, JavaScript, Rust』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く