Egor Gorbachev
@alteregor
6 posts

Configure multiple entry points for Create React App without the eject

Create React App is an opinionated and officially supported tool to set up a React application with no configuration. It comes with some tradeoffs - the build configuration is hidden and you have to use npm run eject script to edit this configuration. In this case, you'll stay one-on-one with fighting build configuration and dependencies mismatch during an upgrade.

A simple Mobx under 50 LOC to understand observer pattern

Mobx uses observer pattern. The classic observer pattern requires users to manually subscribe for changes. Mobx uses a smart approach to create subscriptions implicitly. Some developers claimed it as "magic" of Mobx. The goal of the article is to describe you how implicit subscriptions work under the hood. Knowing this you can always find the reason why a component isn't updating/re-rendering when store changes. In this article I won't use proxy, decorators, classes to keep things simple. I expect you to be familiar with Mobx basics like observable, observer and autorun.

Display calendar using SQL

Do you like solving SQL puzzles? There is a fun exercise you can try if you love racking your brain with tough SQL tasks - write a query to display current month in calendar format. The solution should work with months that have different week count. For example 2010-02-01 includes only 4 weeks, but 2017-10-01 includes 6 weeks. Here is the example SQL output:

Configure HTTPS for wildcard domains with Nginx and Certbot

Certbot allows to automatically install Letsencrypt certificates on a server. For a regular website with only 1 domain, the process of installing can be described as ordinary "Next next install". Things are getting complicated if you need to create a wildcard certificate. Suppose you are creating a white-label website and each company should have its own unique subdomain.

Разница между типом и интерфейсом в TypeScript

Тип и интерфейс в TypeScript часто вызывают путаницу по причине поверхностной схожести. Ситуацию усугубляют устаревшие статьи, необъективные сравнения и style-guid'ы некоторых фреймворков. Например, в Angular по умолчанию включено tslint правило interface-over-type-literal, которое требует использовать интерфейсы вместо типов везде, где возможно. В этой статье разберём разницу между типом и интерфейсом в TypeScript и определимся что же использовать.

Причины отказаться от дефолтных экспортов в JavaScript

В ES6 существует 2 способа экспортировать классы, функции и переменные из модулей - именованный экспорт и экспорт по умолчанию.