Jan 23, 2022Go is about to go a whole lot fasterI’ve been implementing the same (or as similar as possible) trading orderbook algorithm in various languages recently and one thing I noticed with Go is that it has fewer or simpler algorithms in the standard library, for example no deques and maps cannot be ordered like the std::map/BTreeMap in C++/Rust). …Go2 min readGo2 min read
May 22, 2021Components are Pure Overhead2819Ryan CarniatoSolidJS is the most exciting and viable UI framework since React.SolidJS is the most exciting and viable UI framework since React. Just missing a couple of good router and state management packages to increase adoption. Look forward to playing more with it and creating some packages.1 min read1 min read
Apr 1, 2021How To Improve Rendering Performance in a 1,000-Item React List7135Mohammad FaisalHm this is just a "this is how you use react-virtualized" tut, it's actually pretty easy to roll…Hm this is just a "this is how you use react-virtualized" tut, it's actually pretty easy to roll your own virtualization but the crux of the matter is that the native scrollbar on touch devices with acceleration like a touchpad is simply too fast for HTML rendering to keep up. I tried even with one of the fastest rendering frameworks in the world and vanilla. Ultimately for things like grids you need to use canvas with simulated scroll and always draw the cell lines, this way even if the content appear a moment later from some slow framework like React or Angular, it doesn't have jarring flashes of blankness. For a log I guess it doesn't matter so much.1 min read1 min read
Published inITNEXT·Dec 11, 2020How to increase CSS-in-JS performance by 175xI like the convenience of CSS-in-JS especially being able to co-locate styling and improving ease-of-use when using 3rd party components. But I’m not convinced on a few of things: That hashed classes are a “must have” instead of namespaced ones, and could even be a hindrance when needing to select…JavaScript5 min readJavaScript5 min read
Mar 8, 2020Is it time to ditch your React ThemeProvider?JS-in-CSS is now common practice, and your framework of choice probably provides a means to theme with JS Objects and a Provider. …JavaScript2 min readJavaScript2 min read
Jan 29, 2020Using React Hooks for global Redux storesWhen hooks came out there were various articles suggesting Redux might no longer be needed, and ripostes like these which argue (rightly) that useReducer is not a replacement of Redux as it’s cumbersome for a global store: You Might Not Need Redux - Simple Thread TL;DR The useReducer React hook provides a Redux-like means of managing state transitions, but it's no replacement for…www.simplethread.comJavaScript3 min readJavaScript3 min read
Jan 7, 2019Writing an OAuth flow from scratch in NodeJSWhen you search online OAuth seems intimidating; you’ll find lots of useless flow diagrams, and packages like PassportJS make it seem complicated because configuration is challenging as it is. In this express example we’ll authenticate with GitHub, but the same process applies to all OAuth providers. Step 1: Redirect the user to the providers auth access page We could do this…JavaScript3 min readJavaScript3 min read
Published inITNEXT·Oct 11, 2018Writing Redux in 15 lines of code2020 Update: You might be interested in learning how to build a store from scratch which works with Redux Devtools and uses React Hooks to access it anywhere instead: Using React Hooks for global Redux stores When hooks came out there were various articles suggesting Redux might no longer be needed, and ripostes like these…medium.com I was inspired to write this today after a colleague new to React complained about how much boilerplate is involved when…React3 min readReact3 min read
Jan 5, 2016Testing UI projects: we’re doing it wrongJavaScript has grown up and people feel their large UI projects must be tested. But I argue that while we’ve moved more logic to the client, testing as it’s usually done is wrong and will cost your product time and money whilst not adding much value. The problem with Unit Tests Unit tests originated from…Testing4 min readTesting4 min read