We have survived the first month of 2021. Congrats 🥳
It’s the first birthday of this Newsletter, I have written this email every month for an year now. Thanks to all of you who subscribed and supported me. 🙇♂️
It’s the jQuery birthday month 🎂.
The year started off with a riot in US capitol building which then turned every social media company against President Donald Trump. While giants like Facebook and Twitter blocked the President everywhere, a conservative free speech outlet Parler started gaining followers by second. Parler started stuttering as the loads increased and later altogether as AWS banned them from their servers. But here’s a tech lesson from Parler debacle.
In other words, if you make a table in a database with an integer primary key, you can only put 2.1 billion records in it. I remember when this happened to the tweets table at Twitter. It was identified and planned for months ahead of time.
Whatsapp was all set to update it’s terms and services starting next month and share some user information with their parent company Facebook. But there was widespread outrage regarding the policy to the point that WhatsApp had to claim a misinformation campaign later. People rushed to competing platforms like Signal and Telegram; Signal in particular gaining about 40 million users.
The joy was short-lived as Signal went down for long time and most people went back to WhatsApp following full page ads promising privacy from Facebook. How useful is a chat app if some of your friends are not on it?
The third company of the month is GameStop. They are a video game retailer in US who were kinda struggling because of the pandemic, blowing off some Steam. Some very large hedge funds were shorting the stocks for GameStop (well, including AMC theatres, Bed Bath and Beyond and others) and betting on it to fail. At some point, they went completely overboard as to have borrowed 130% of the stock.
This is when a subreddit that gambles on stock market called r/wallstreetbets caught a whiff of the money going round. The subreddit in a collective effort (raid!) pushed up prices of the stock and suffice to say, it skyrocketed.
Short after hedge funds starting complaining that the free market was too free, Robinhood the popular stock trading app stopped trading $GME and $AMC making everyone involved angry.
Tech Companies caught in this gold rush:
aspect-ratio. No more
padding-bottomtricks. (As always, check out browser compatibility). This update also defaults links with
rel=noopenerto prevent tabnabbing. It might be too quick to switch the error off on eslint, but it’s safer now.
styled-componentshappens to be my favourite styling library. This best practices blog from Josh is an absolute treasure chest.
Let’s look at state management in React.
I have maintained my apprehension against using Redux because of my experiences of using it so far. One of my favourite instances are from starting out as a contractor on a project my first ticket was that all dropdowns on the page were being triggered simultaneously. A developer had put the state for dropdown in Redux not anticipating that there could ever be two dropdowns on the same page!
I can currently live with no third party libraries, just React Context, but then that’s not state management, it’s just global state. As Mark Erickson eloquently puts it:
Context is a form of Dependency Injection. It is a transport mechanism - it doesn’t “manage” anything. Any “state management” is done by you and your own code, typically via useState/useReducer.
Link to his blog post explaining differences in detail.
There are a large number of solutions for state management that are currently available for React. Here is how they stack up:
State management libraries can be roughly categorized 2 ways: ⏺ Single (global, atomic store) vs. multi (local, distributed) ⚡️ Direct (manipulate state) vs. indirect (send events) Here’s how I’d categorize some JS state management libraries:
Redux or comparable solutions pass only the store object to the components meaning that all components in the tree do not have to rerender if one value in the store changes. But this is not the case with Context. But this is changing, once this experiment goes through,
useSelectedContext will enable to users to select when they want components to rerender.