exadel-inc / esl

Lightweight and flexible UI component library based on web components technology for creating basic UX modules
https://esl-ui.com
MIT License
58 stars 9 forks source link

[🔨 code style]: update DeviceDetector usages to exact conditions import #530

Open ala-n opened 3 years ago

ala-n commented 3 years ago

As an ESL architect, I want to have well tree-shakeable code.

It is requested to replace all DeviceDetector usages with the exact condition imports:

Before:

import {DeviceDetector} from 'esl-utils/environmant/device-detector';

if (DeviceDetector.isIE) { ... }

After:

import {isIE} from 'esl-utils/environmant/device-detector';

if (isIE) { ... }

The issue relates to the #529 change and will be available with the #529 issue resolve.

Scope of the issue:

ala-n commented 3 years ago

Unblocked with #546 merge of #529 issue

aswiniip commented 3 years ago

I would like to take this issue. Would you please assign this to me @ala-n ? And please also walk me through what do I have to do. Which are the files where these changes are required?

ala-n commented 3 years ago

Sorry, @aswinidev, it looks like this issue is going to be discussed additionally and potentially closed. After a deeper investigation, it looks like there is no benefit for the library to replace usages to direct ones. Almost all checks from DeviceDetector are used in the esl-media-query utility, which is used almost everywhere. CC: @exadel-inc/esl-core-team