RSSAmplifier

Blog

To Love and to Learn (Gil Tayar's Blog)

JavaScript, Testing, ES Modules, and other ruminations on software development

gils-blog.tayar.orgRSS feed ↗12 posts

Latest posts

Scaling the Codebase (Part 4): Wrapping Everything in a Monorepo

photo by photo by Lanty on Unsplash This is the fourth post in a four part blog series: Introduction Modular Code Architecture Reducing Developer Friction Wrapping Everything in a Monorepo (this part) Managing hundreds of packages is not trivial. The standard way of storing package code is one Git repository per package. But when dealing with a modular codebase that has hundreds of packages, this…

Scaling the Codebase (Part 3): Reducing Developer Friction

photo by Vidar Nordli-Mathisen on Unsplash This is the third post in a four part blog series: Introduction Modular Code Architecture Reducing Developer Friction (this part) Wrapping everything in a Monorepo Independence helps developers maintain their velocity in the face of an increasingly large codebase. The reason is that it removes the friction from the development process. And reducing…

Scaling the Codebase (Part 2): Modular Code Architecture

photo by Raphael Koh on Unsplash This is the second post in a four part blog series: Introduction Modular Code Architecture (this part) Reducing Developer Friction Wrapping everything in a Monorepo An interesting thing to note about how Shawn worked was how easy it was for her to enter new areas of the code. Another interesting thing to notice was her lack of fear: she deployed code she’d never…

Scaling the Codebase (Part 1): Avoiding Monolithic Spaghetti Code

image by freeimageslive.co.uk - creator This is the first post in a four part blog series: Introduction (this part) Modular Code Architecture Reducing Developer Friction Wrapping Everything in a Monorepo How does one build a scalable development team? How does one ensure that even if the size of the codebase of a company grows and the size of the development team grows, the development velocity…

Using ES Modules (ESM) in Node.js: A Practical Guide (Part 3)

(Hey, if you want to come work with me at Roundforest, and try out ESM on Node.js, feel free to find me on LinkedIn or on Twitter (@giltayar)) This is part 3 of the guide for using ES modules in Node.js. Part 1: the basics of ESM The simplest Node.js ESM project Using the .js extension for ESM Part 2: “exports” and its uses (including dual-mode libraries) The exports field Multiple exports…

Using ES Modules (ESM) in Node.js: A Practical Guide (Part 2)

(Hey, if you want to come work with me at Roundforest, and try out ESM on Node.js, feel free to find me on LinkedIn or on Twitter (@giltayar)) This is part 2 of the guide for using ES modules in Node.js. Part 1: the basics of ESM The simplest Node.js ESM project Using the .js extension for ESM Part 2 (this document): “exports” and its uses (including dual-mode libraries) The exports field Multiple…

Using ES Modules (ESM) in Node.js: A Practical Guide (Part 1)

(Hey, if you want to come work with me at Roundforest, and try out ESM on Node.js, feel free to find me on LinkedIn or on Twitter (@giltayar)) ES Modules are the future of modules in JavaScript. They already are the rule in the frontend, but till now they couldn’t have been used in Node.js. Well, it seems that now they can. Moreover, the Node.js community is fast at work at adding support for…

JSDoc typings: all the benefits of TypeScript, with none of the drawbacks

(Hey, if you want to come work with me at Roundforest, and try out JSDoc typing, feel free to find me on LinkedIn or on Twitter (@giltayar)) TypeScript! For me, it’s a love-hate relationship. I started my developer life in statically typed languages (well, if we ignore Basic, which is dynamically typed): C, C++, and Java. Then somewhere around 2010, I had the good fortune to start working in…

Backend Devs, don't upgrade to the Apple Silicon Macs... Yet!

Update, as of November 2021 ! I just tried out the new Macbook Pro M1s on our codebase, And they seem to work out really well. I’ve seen mixed results in regards to Docker compatibility, but it depends on what you’re running in Docker. Our stack is a Node.js stack, and things are pretty compatible these days. The new Apple Macs are a wonder. As the now famous AnandTech graph shows us, Apple’s ARM…

Mock all you want: supporting ES modules in the Testdouble.js mocking library

ES Module are a new way of using modules in JavaScript. Having ES modules (ESM) in Node.js means that you can now write: import fs from 'fs' import { doSomething } from './mylib.mjs' instead of using the classic CommonJS (CJS) modules: const fs = require ( 'fs' ) const { doSomething } = require ( './mylib.js' ) If you want to learn more about the whys and the hows (and are maybe wondering about…

Immutably setting a value in a JS array (or how an array is also an object)

Immutably setting a value in a JS array (or how an array is also an object) # Reducers in Redux are a place where functional programming, and the concept of immutability, are very noticeable. Immutability is not natural in Javascript, so some resort to libraries like Immutable . Me? I prefer native arrays, objects, and primitives, to library-defined data-structures — so I resort to various ES6…

Iterating Over Emoji Characters the ES6 Way

Iterating Over Emoji Characters the ES6 Way # Let’s say we want to write a function that turns a string into an array of characters. Let’s try and write it: Simple. And what does that console.log display? [ 'R' , 'o' , 'b' , 'i' , 'n' , ' ' , 'H' , 'o' , 'o' , 'd' ] Good! But does it support Unicode? Let’s try a string with Hebrew characters: And… [ 'R' , 'o' , 'b' , 'i' , 'n' , ' ' , 'H' , 'o' ,…