Skip to content

Commit

Permalink
refactor(esl-media-query): !important! deprecation of `ESLMediaRuleLi…
Browse files Browse the repository at this point in the history
…st.parse` (#2498)

MINOR VERSION: `ESLMediaRuleList.parse` deprecated, signature is going to be significantly changed in 5.0.0
  • Loading branch information
fshovchko committed Jul 10, 2024
1 parent e95e414 commit c07a9c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/modules/esl-media-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ ESLMediaRuleList.parse('@XS => {option: 1} | @+SM => {option: 2}', evaluate); //
ESLMediaRuleList.parseTuple('@xs|@sm|@md|@lg|@xl', '1|2|3|4|5') // String payload example
ESLMediaRuleList.parseTuple('@xs|@sm|@md|@lg|@xl', '1|2|3|4|5', Number) // Numeric payload sample
```
**Note**: Method `ESLMediaRuleList.parse` is deprecated, and will be reintroduced in ESL v5.0.0 with a different signature. For now use `ESLMediaRuleList.parseTuple` or `ESLMediaRuleList.parseQuery` instead.

#### ESLMediaRuleList API

Expand Down
8 changes: 8 additions & 0 deletions src/modules/esl-media-query/core/esl-media-rule-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class ESLMediaRuleList<T = any> extends SyntheticEventTarget {
public static OBJECT_PARSER = <U = any>(val: string): U | undefined => evaluate(val);

/**
* @deprecated Method will be reintroduced in v5.0.0 with a different signature. For now use ESLMediaRuleList.parseQuery instead
*
* Creates `ESLMediaRuleList` from string query representation
* Expect serialized {@link ESLMediaRule}s separated by '|'
* Uses exact strings as rule list values
Expand All @@ -43,6 +45,8 @@ export class ESLMediaRuleList<T = any> extends SyntheticEventTarget {
*/
public static parse(query: string): ESLMediaRuleList<string>;
/**
* @deprecated Method will be reintroduced in v5.0.0 with a different signature. For now use ESLMediaRuleList.parseQuery instead
*
* Creates `ESLMediaRuleList` from string query representation.
* Expect serialized {@link ESLMediaRule}s separated by '|'
*
Expand All @@ -51,6 +55,8 @@ export class ESLMediaRuleList<T = any> extends SyntheticEventTarget {
*/
public static parse<U>(query: string, parser: RulePayloadParser<U>): ESLMediaRuleList<U>;
/**
* @deprecated Method will be reintroduced in v5.0.0 with a different signature. For now use ESLMediaRuleList.parseTuple instead
* Creates `ESLMediaRuleList` from two strings with conditions and values sequences
*
* @param mask - media conditions tuple string (uses '|' as separator)
Expand All @@ -63,6 +69,8 @@ export class ESLMediaRuleList<T = any> extends SyntheticEventTarget {
*/
public static parse(mask: string, values: string): ESLMediaRuleList<string>;
/**
* @deprecated Method will be reintroduced in v5.0.0 with a different signature. For now use ESLMediaRuleList.parseTuple instead
*
* Creates `ESLMediaRuleList` from two strings with conditions and values sequences
*
* @param mask - media conditions tuple string (uses '|' as separator)
Expand Down

0 comments on commit c07a9c5

Please sign in to comment.