From f67a35ddcebd0e23a14b2b637d2ee7d74fca09d8 Mon Sep 17 00:00:00 2001 From: Lucas Bebber Date: Mon, 31 Aug 2020 15:14:14 -0300 Subject: [PATCH 1/3] Prevent from displaying modifier error logs on prod workspaces --- manifest.json | 2 +- react/applyModifiers.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6228eb0..d8c7df1 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "vendor": "vtex", "name": "css-handles", - "version": "0.4.3", + "version": "0.4.4-beta.0", "title": "CSS Handles", "description": "Utility for creating CSS Handles on store components", "builders": { diff --git a/react/applyModifiers.ts b/react/applyModifiers.ts index 4b872dc..739539b 100644 --- a/react/applyModifiers.ts +++ b/react/applyModifiers.ts @@ -31,6 +31,10 @@ const displayModifierErrors = debounce(() => { * rather than a potentially huge wall of errors. */ function logModifierError(modifier: InvalidModifier) { + // eslint-disable-next-line no-undef + if (process.env.NODE_ENV !== 'development') { + return + } invalidModifiers.add(modifier) displayModifierErrors() } From a9e8b67936a09a2cc283c7a4d69c66465635dc40 Mon Sep 17 00:00:00 2001 From: Lucas Bebber Date: Mon, 31 Aug 2020 15:14:37 -0300 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abd9ee6..b7750a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Modifier errors are only displayed on dev workspaces. ## [0.4.3] - 2020-08-31 ### Changed From 70ba6cfa93b29f1c1827b244204db52fc6c8f524 Mon Sep 17 00:00:00 2001 From: Lucas Bebber Date: Mon, 31 Aug 2020 15:18:40 -0300 Subject: [PATCH 3/3] Remove stray beta version bump --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d8c7df1..6228eb0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "vendor": "vtex", "name": "css-handles", - "version": "0.4.4-beta.0", + "version": "0.4.3", "title": "CSS Handles", "description": "Utility for creating CSS Handles on store components", "builders": {