Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
warn about dropping backwards compatibility just once (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
lieut-data committed Jun 8, 2018
1 parent 2ef5276 commit c000a81
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,16 @@ export const isMinimumServerVersion = (currentVersion, minMajorVersion = 0, minM
// Dot version is equal
return true;
};

let sentMessageToRemoveBackwardsCompatibility = false;
export const sendMessageToRemoveBackwardsCompatibility = (currentVersion, minVersion) => {
if (process.env.NODE_ENV !== 'production' && currentVersion > minVersion) { //eslint-disable-line no-process-env
if (sentMessageToRemoveBackwardsCompatibility) {
return;
}

console.warn('You can now remove backwards-compatibility code from the project, as referenced in the stacktrace below.'); //eslint-disable-line no-console
sentMessageToRemoveBackwardsCompatibility = true;
}
};

Expand Down

0 comments on commit c000a81

Please sign in to comment.