Parsing the pattern "Module" in JavaScript

In many programming languages, there are mechanisms that allow you to hide, for example, the methods and properties of classes. jаvascript does not have built-in tools that allow, without additional effort, to achieve such effects. However, such things can be imitated using other language features.
 
 
Parsing the pattern "Module" in JavaScript

 
The material we are translating today is devoted to analyzing the design pattern "Module", which allows you to hide private information in closures, giving access only to what the developer decided to make publicly available. This article is intended mainly for beginning programmers - for those who...
+ 0 -

Different prices for warehouses in multi-warehouse. Completion of 1C-Bitrix

There was an online store and a b2b platform from one company on the 1c-Bitrix system. The company grew and its warehouses appeared and added warehouses of partners that needed to be displayed. There was a need to display balances in several warehouses.
 
And what does Bitrix tell us: Please go to the editorial office of "Business" and everything will be fine and immediately. The editorial board went over and it turned out that the multi-value and multi-folding in 1C-Bitrix live a separate life. The first is needed to display different prices for different user groups, and the second one is used ...
+ 0 -

Digest of fresh materials from the world of the frontend for the last week № 326 (August 6 - 1? 2018)

We bring to your attention a selection with links to new materials from the frontend area and near it.
 
 
Digest of fresh materials from the world of the frontend for the last week № 326 (August 6 - 1? 2018)
 
Media | | Web development | | CSS | | jаvascript | | Browsers | | Entertaining
 
 
# 65 - Igor Sheko about how to become a protruding thimlide from the serial startup
 
Podcast "CSSSR" News 512 - Issue №18 (??? - ???)
 
"Devshahta podcast": # 45 - When the frontend becomes deodar
 
...
HTML / CSS
+ 0 -

Trends in design in 2018: forecast and reality

Trends in design in 2018: forecast and reality  
 
Translator's note: this remarkable article was not translated for Khabra at the beginning of the year, nor later. While it is really useful and deserves attention. Therefore, despite the fact that almost ⅔ 18 years have already lived, I still decided to translate. At the same time, I compared forecasts with reality, which was left with comments on the text.
 
 
Attention: under the cut is a lot of heavy gifok and beauty!
 
Mindsparkle Mag closely follows the news in the world of design and publishes daily on his blog all the fun. After analyzing the information for 201? the specialists ...
+ 0 -

What's wrong with the popular articles telling that foo is faster than bar?

Translator's note:
I also thought that the time of the articles "What is faster - double or single quotes?" passed 10 years ago. But here is a similar article ("What performance tricks actually work") recently gathered on Reddit a relatively high rating and even got in PHP digest on Habré. Accordingly, I decided to translate the article with a critical analysis of these and similar "tests".
 
There are many articles (and even entire sites) devoted to launching a variety of tests comparing the performance of various syntactic constructions, and claiming on this basis that one is faster than ...
+ 0 -

How to make a user search on GitHub without React + RxJS 6 + Recompose

This article is the answer to the article-translation "How to make a user search using GitHub using React + RxJS 6 + Recompose" , which literally yesterday taught us how to use React, RxJS and Recompose together. Well, I propose now to see how this can be realized without these tools.
 
 
How to make a user search on GitHub without React + RxJS 6 + Recompose  
The "disappearing" framework. SvelteJS , but it is so simple that you do not need to have experience of using it to understand the code.
 
 
We do the same thing:
 
 
 
 
Without classes, working with a life cycle or setState.
 
Yes, w...
+ 0 -

PWA is easy. Hello Habr

We continue our acquaintance with Progressive Web Applications. After the theoretical the last part of It's time to move on to practice.
 
 
Today we will build a simple, but full-fledged PWA "Hello Habr".
 
 
PWA is easy. Hello Habr  
 
 
The application is available at https://altrusl.github.io/habr-pwa/hello-habr/ . When opened in a browser on your mobile device, you can add a shortcut to your home screen and launch in full screen mode.
 
Here it is or a similar extension that is a local web server...
+ 0 -

Redux vs. React Context API

Redux vs. React Context API  
 
In React 16.? a new Context API was added. The new in the sense that old Context API was off-screen, most people either did not know about its existence, or did not use it, because the documentation advised to avoid using it.
 
 
However, now the Context API is a full-fledged part of React, open to use (not the same as before, officially).
 
greatly exaggerated ".
 
 
In this post I want to talk about how the new Context API works, what it looks like to Redux, when you can use Context instead of Redux and why Context does not replace Redux in every case.
 
 
If you need a simple ...
+ 0 -

Digest of fresh materials from the world of the frontend for the last week №325 (July 30 - August ? 2018)

We bring to your attention a selection with links to new materials from the frontend area and near it.
 
 
Digest of fresh materials from the world of the frontend for the last week №325 (July 30 - August ? 2018)
 
Media | | Web development | | CSS | | jаvascript | | Browsers | | Entertaining
 
 
# 64 - Oleg Mokhov on how to manage the developers of comfortably and correctly.
 
Podcast "CSSSR" News 512 - Issue №17 (??? - ???)
 
Podcast "Devshaht": Night frontend # 44 -How to transplant all developers into the company on your bike
 
 
...
HTML / CSS
+ 0 -

Logging of activity using Web Beacon API

Logging of activity using Web Beacon API
 

The Beacon API is a jаvascript-based interface for:


 
sending a small amount of data to the server from the browser, without waiting for an answer. In this article, we will consider in which cases the Beacon API will be useful than it differs from using XMLHTTPRequest (Ajax) for the same purposes and how to use it.
 

Why do we need the next API?


 

The Beacon API is used to send small amounts of data to the server. without waiting for a response . The last part of the statement is the most interesting. Beacon API is designed specifically to send data and forget about them. Do ...[/h][/h]

+ 0 -