Skip to content

Commit 08f525f

Browse files
authored
Merge pull request #3406 from exadel-inc/epic/deprecates-cleanup
refactor: remove deprecated properties and methods across ESL
2 parents 34d9805 + e36e19f commit 08f525f

File tree

14 files changed

+28
-183
lines changed

14 files changed

+28
-183
lines changed

packages/esl/src/esl-alert/core/esl-alert.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ export class ESLAlert extends ESLToggleable {
2929
public static override is = 'esl-alert';
3030
public static override observedAttributes = ['target'];
3131

32-
/**
33-
* Legacy default show/hide params for all ESLAlert instances
34-
* @deprecated Use {@link ESLAlert.DEFAULT_PARAMS} instead
35-
*/
36-
public static defaultConfig: ESLAlertActionParams = {};
37-
3832
/** Default show/hide params for all ESLAlert instances */
3933
public static override DEFAULT_PARAMS: ESLAlertActionParams = {
4034
hideTime: 300,
@@ -74,7 +68,7 @@ export class ESLAlert extends ESLToggleable {
7468

7569
protected override mergeDefaultParams(params?: ESLToggleableActionParams): ESLToggleableActionParams {
7670
const type = this.constructor as typeof ESLAlert;
77-
return Object.assign({}, type.defaultConfig, type.DEFAULT_PARAMS, this.defaultParams || {}, params || {});
71+
return Object.assign({}, type.DEFAULT_PARAMS, this.defaultParams || {}, params || {});
7872
}
7973

8074
protected override attributeChangedCallback(attrName: string, oldVal: string, newVal: string): void {

packages/esl/src/esl-event-listener/core/api.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ export class ESLEventUtils {
3131
/** Gets {@link ESLListenerDescriptorFn}s of the passed object */
3232
public static descriptors = getDescriptors;
3333

34-
/**
35-
* Gets auto {@link ESLListenerDescriptorFn}s of the passed object
36-
*
37-
* @deprecated alias for `descriptors(host, {auto: true})`
38-
*/
39-
public static getAutoDescriptors = (host: object): ESLListenerDescriptorFn[] => getDescriptors(host, {auto: true});
40-
4134
/**
4235
* Decorates passed `key` of the `host` as an {@link ESLListenerDescriptorFn} using `desc` meta information
4336
* @param host - object holder of the function to decorate

packages/esl/src/esl-event-listener/core/targets/intersection.event.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export class ESLIntersectionEvent extends Event implements IntersectionObserverE
1313
public static readonly IN = 'intersects:in';
1414
/** Type of event that will be dispatched on both viewport enter and exit */
1515
public static readonly TYPE = 'intersects';
16-
/** @deprecated use {@link TYPE} instead */
17-
public static readonly type = this.TYPE;
1816

1917
public override readonly type: ESLIntersectionEventType;
2018

packages/esl/src/esl-event-listener/core/targets/resize.target.event.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import type {ESLResizeObserverTarget} from './resize.target';
55
/** Custom event that {@link ESLResizeObserverTarget} produces */
66
export class ESLElementResizeEvent extends UIEvent implements ResizeObserverEntry {
77
public static readonly TYPE = 'resize';
8-
/** @deprecated Use {@link TYPE} instead */
9-
public static readonly type = this.TYPE;
108

119
public override readonly type: typeof ESLElementResizeEvent.TYPE;
1210

packages/esl/src/esl-event-listener/core/targets/swipe.target.event.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ export interface ESLSwipeGestureEventInfo {
3232
*/
3333
export class ESLSwipeGestureEvent extends UIEvent implements ESLSwipeGestureEventInfo {
3434
public static readonly TYPE = 'swipe';
35-
/** @deprecated Use {@link TYPE} instead */
36-
public static readonly type = this.TYPE;
3735

3836
public override readonly type: typeof ESLSwipeGestureEvent.TYPE;
3937

packages/esl/src/esl-event-listener/core/targets/wheel.target.event.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ export interface ESLWheelEventInfo {
2121
*/
2222
export class ESLWheelEvent extends UIEvent implements ESLWheelEventInfo {
2323
public static readonly TYPE = 'longwheel';
24-
/** @deprecated Use {@link TYPE} instead */
25-
public static readonly type = this.TYPE;
2624

2725
public override readonly type: typeof ESLWheelEvent.TYPE;
2826

packages/esl/src/esl-media-query/core/common/media-shortcuts.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const SHORTCUTS_STORE = Symbol.for('__esl_media_shortcuts');
2929
*
3030
* @implements IMediaQueryPreprocessor statically
3131
*/
32-
@ExportNs('EnvShortcuts')
3332
@ExportNs('MediaShortcuts')
3433
export class ESLMediaShortcuts {
3534
/** Returns shortcuts map, ensures there is a single instance */
@@ -66,25 +65,8 @@ export class ESLMediaShortcuts {
6665
if (!SHORTCUT_REGEXP.test(match)) return NOT_ALL;
6766
return this.resolve(match);
6867
}
69-
70-
// Legacy support
71-
/** @deprecated use `set` method instead (Going to be removed in ESL 6.0.0)*/
72-
public static add = ESLMediaShortcuts.set;
73-
74-
/**
75-
* Remove mapping for passed shortcut term.
76-
* @deprecated use `ESLEnvShortcuts.set(shortcut, false)` instead (Going to be removed in ESL 6.0.0)
77-
*/
78-
public static remove(shortcut: string): boolean {
79-
const contain = this.shortcuts.has(shortcut.toLowerCase());
80-
ESLMediaShortcuts.set(shortcut, NOT_ALL);
81-
return contain;
82-
}
8368
}
8469

85-
/** @deprecated use `ESLMediaShortcuts` instead (Going to be removed in ESL 6.0.0) */
86-
export const ESLEnvShortcuts = ESLMediaShortcuts;
87-
8870
// Touch check
8971
ESLMediaShortcuts.set('touch', isTouchDevice);
9072

@@ -107,8 +89,6 @@ declare global {
10789
[SHORTCUTS_STORE]: Map<string, MediaQueryStaticCondition>;
10890
}
10991
export interface ESLLibrary {
110-
/** @deprecated use `ESLMediaShortcuts` instead (Going to be removed in ESL 6.0.0) */
111-
EnvShortcuts: typeof ESLMediaShortcuts;
11292
MediaShortcuts: typeof ESLMediaShortcuts;
11393
}
11494
}

packages/esl/src/esl-utils/async/promise.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,3 @@ export function resolvePromise<T>(arg: T | PromiseLike<T>): Promise<T> {
4545
export function rejectPromise<T = never>(arg?: T | PromiseLike<T>): Promise<T> {
4646
return Promise.reject(arg);
4747
}
48-
49-
/**
50-
* Promise utils helper class
51-
* Note: use individual methods in case you need correct "tree shaking"
52-
* @deprecated use separate function extend
53-
*/
54-
export abstract class PromiseUtils {
55-
static fromTimeout = promisifyTimeout;
56-
static fromEvent = promisifyEvent;
57-
static fromMarker = promisifyMarker;
58-
59-
static repeat = repeatSequence;
60-
static tryUntil = tryUntil;
61-
62-
static deferred = createDeferred;
63-
static resolve = resolvePromise;
64-
static reject = rejectPromise;
65-
}

packages/esl/src/esl-utils/dom/rtl.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
1-
const DEFAULT_SCROLL_TYPE = 'negative';
2-
3-
/** @deprecated RTL scroll browser behaviors now always returns `negative` value */
4-
export type ScrollType = typeof DEFAULT_SCROLL_TYPE;
5-
61
/** Checks if the element in a RTL direction context */
72
export const isRTL = (el?: HTMLElement | null): boolean => getComputedStyle(el || document.body).direction === 'rtl';
83

9-
/** @deprecated scroll type is now consistent and always returns a `negative` value */
10-
export const testRTLScrollType = (): ScrollType => {
11-
return DEFAULT_SCROLL_TYPE;
12-
};
13-
14-
/** @deprecated scroll type is now consistent and always returns a `negative` value */
15-
export const RTLScroll = {
16-
/** @returns RTL scroll type (lazy, memoized) */
17-
get type(): ScrollType {
18-
return DEFAULT_SCROLL_TYPE;
19-
}
20-
};
21-
224
export const normalizeScrollLeft = (el: HTMLElement, value: number | null = null, isRtl: boolean = isRTL(el)): number => {
235
value = (value === null) ? el.scrollLeft : value;
246
return isRtl ? el.scrollWidth - el.clientWidth + value : value;
Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import {ExportNs} from './export-ns';
2-
31
const {userAgent, vendor, platform} = window.navigator;
42

53
// IE Detection
@@ -28,9 +26,6 @@ export const isSafari = isWebkit && /^((?!chrome|android).)*safari/i.test(userAg
2826
// Blink
2927
export const isBlink = isWebkit && !isSafari;
3028

31-
/** @deprecated bot detection no longer works (speed bot now has no specific) and supported from ESL side */
32-
export const isBot = /Chrome-Lighthouse|Google Page Speed Insights/i.test(userAgent);
33-
3429
// Mobile
3530
export const isAndroid = /Android/i.test(userAgent);
3631
export const isMobileIOS13 = /* iOS 13+ detection */ (platform === 'MacIntel' && window.navigator.maxTouchPoints > 1);
@@ -53,62 +48,3 @@ export const hasHover = !matchMedia('(hover: none)').matches;
5348

5449
/** true if a user prefers to minimize the amount of non-essential motion */
5550
export const isReducedMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
56-
57-
/**
58-
* Device detection utility
59-
* @readonly
60-
* @deprecated use separate checks from the same module instead
61-
*/
62-
@ExportNs('DeviceDetector')
63-
export abstract class DeviceDetector {
64-
// IE Detection
65-
public static readonly isTrident = isTrident;
66-
public static readonly isIE = isIE;
67-
68-
// Edge Detection
69-
public static readonly isEdgeHTML = isEdgeHTML;
70-
public static readonly isBlinkEdge = isBlinkEdge;
71-
public static readonly isEdge = isEdge;
72-
73-
// Gecko
74-
public static readonly isGecko = isGecko;
75-
public static readonly isFirefox = isFirefox;
76-
77-
// Opera / Chrome
78-
public static readonly isOpera = isOpera;
79-
public static readonly isChrome = isChrome;
80-
81-
// Webkit
82-
public static readonly isWebkit = isWebkit;
83-
84-
// Safari
85-
public static readonly isSafari = isSafari;
86-
87-
// Blink
88-
public static readonly isBlink = isBlink;
89-
90-
// Bot detection
91-
public static readonly isBot = isBot;
92-
93-
// Mobile
94-
public static readonly isAndroid = isAndroid;
95-
public static readonly isMobileIOS13 = isMobileIOS13;
96-
public static readonly isMobileIOS = isMobileIOS;
97-
public static readonly isLegacyMobile = isLegacyMobile;
98-
99-
public static readonly isMobile = isMobile;
100-
public static readonly isMobileSafari = isMobileSafari;
101-
102-
// Touch Detection
103-
public static isTouchDevice = isTouchDevice;
104-
105-
// Hover check
106-
// Note: always true for IE
107-
public static hasHover = hasHover;
108-
}
109-
110-
declare global {
111-
export interface ESLLibrary {
112-
DeviceDetector: typeof DeviceDetector;
113-
}
114-
}

0 commit comments

Comments
 (0)