Open in app

Sign In

Write

Sign In

Alberto Gasparin
Alberto Gasparin

127 Followers

Home

About

Jul 11, 2019

The pitfalls of async operations via React Context API

React provides a nice API to share state globally and across components, the Context API, but while working at scale in Jira, we discovered how it can easily become a developer’s nightmare if not properly guarded. It all starts with a simple component Letʼs imagine we want to create a dropdown that renders a list of categories…

Java Script

5 min read

The pitfalls of async operations via React Context API
The pitfalls of async operations via React Context API
Java Script

5 min read


Jun 24, 2019

Rethinking React dependency injection

Dependency injection and component injection for testing purposes is not a new topic. Indeed, the ability to provide a custom implementation of a component/hook while testing or writing storybooks and examples it is extremely valuable. react-magnetic-di enables it without the downsides of prop based solutions. The dependencies problem While coding complex components that…

Java Script

4 min read

Rethinking React dependency injection
Rethinking React dependency injection
Java Script

4 min read


Jun 18, 2019

React-sweet-state: Redux and Context, the yummy parts

For the past months I’ve been part of the team responsible to transform Atlassian’s Jira into a modern SPA. We took this opportunity to experiment with new concepts, especially around state management. Our first macro component to be built was the navigation app. A navigation app poses quite a few…

React

5 min read

React-sweet-state: Redux and Context, the yummy parts
React-sweet-state: Redux and Context, the yummy parts
React

5 min read


Aug 14, 2018

Unstated and render props pitfalls for data fetching

One of the new patterns getting popular across the React community is the render props pattern and Unstated is an experiment of using that pattern to manage state across your app. An interesting approach that exposes some of the render props challenges. First of all, this is not a critique…

Java Script

5 min read

Unstated and render props pitfalls for data fetching
Unstated and render props pitfalls for data fetching
Java Script

5 min read


Feb 6, 2018

Fixing coin mining scripts abuse on the Web

Recently, while surfing on my laptop, I noticed the fan suddenly starting making a lot of noise and, to my surprise, I saw in “Activity Monitor” that 3 Safari processes from 2 domains were loading 100% of my CPU units each! …

Java Script

3 min read

Fixing coin mining scripts abuse on the Web
Fixing coin mining scripts abuse on the Web
Java Script

3 min read


Dec 15, 2017

Testing frontend integration with 3rd party services

How to run integration tests of frontend code when you have no control over the API service (and the service has no test environment)? — TL;DR: provide the service endpoint dynamically, so it can be changed to localhost and return fixtures during testing. Bonus: use node-replay to automatically record requests/responses. Most articles about UI integration/E2E tests assume that you are in control of the API service, so you can customise its setup and teardown to…

Java Script

3 min read

Testing frontend integration with 3rd party services
Testing frontend integration with 3rd party services
Java Script

3 min read


Dec 5, 2017

Forcing state reset on a React component by using the key prop

Did you know that you can use the key prop to force reset a component state? Most of the times you want to prevent that, but sometimes it is particularly helpful and helps keeping your code clean. What is the key prop? React key prop is a special prop that can be added to any…

Java Script

3 min read

Forcing state reset on a React component by using the key prop
Forcing state reset on a React component by using the key prop
Java Script

3 min read


Oct 16, 2017

Manipulating cross origin images with HTML canvas

HTML canvas interface implements a series of security related features that prevent cross domain manipulation unless explicitly allowed by the origin domain. What does that mean in practice? In order to be able to read the pixels data of an image on a different domain, the hosting server must first…

Java Script

2 min read

Manipulating cross origin images with HTML canvas
Manipulating cross origin images with HTML canvas
Java Script

2 min read


Aug 25, 2017

Getting plain text from user input on a contenteditable element

It is no news that HTML contenteditable is a mess, however it is challenging even getting a plain text value of the user input. — Let me begin by saying that unless you have really specific needs, textarea is what you should use to get plain text input. The reason why I had to use contenteditable is because I need the box to be content aware and adapt its size dynamically (both width and height).

Java Script

3 min read

Getting plain text from user input on a contenteditable element
Getting plain text from user input on a contenteditable element
Java Script

3 min read


Aug 18, 2017

Fixing export default on Webpack when bundling a library

Required workaround to properly distribute a library built with Typescript, Babel and Webpack. — As my latest project is a standalone library, I decided to give Typescript a go in order to increase consistency and documentation. After spending some time in order to get the Typescript compiler building my files, I realised that I was missing the great Babel plugin ecosystem. So, I decided…

Java Script

2 min read

Fixing export default on Webpack when bundling a library
Fixing export default on Webpack when bundling a library
Java Script

2 min read

Alberto Gasparin

Alberto Gasparin

127 Followers

Being a Frontend Developer is learning something new every day

Following
  • Alex Di Mango

    Alex Di Mango

  • Julie Zhuo

    Julie Zhuo

  • Dr James Wootton

    Dr James Wootton

  • Christian Heilmann

    Christian Heilmann

  • Netflix Technology Blog

    Netflix Technology Blog

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech