From 0f463fd668b08b799bcadfa45af3a87ade39e0f7 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Thu, 23 Aug 2018 17:44:59 -0400 Subject: [PATCH 1/3] Docs: Update javascript doc to allow Array methods Since methods like `Array.includes()` are now able to be used safely in Calypso, this updates the documentation to explain that. --- docs/coding-guidelines/javascript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/coding-guidelines/javascript.md b/docs/coding-guidelines/javascript.md index 4a3fe4e103038..dc2fa8d322ac9 100644 --- a/docs/coding-guidelines/javascript.md +++ b/docs/coding-guidelines/javascript.md @@ -594,7 +594,7 @@ We encourage you to make use of these methods in favor of traditional `for` and - [`Array#some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) - [`Array#every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) -While ES2015 and beyond include many more Array prototype methods, these cannot be used due to complications with polyfills. Instead, you are encouraged to use their [Lodash](https://lodash.com/) equivalents, among many other Lodash methods: +As of https://github.com/Automattic/wp-calypso/pull/25419, Calypso includes polyfills for many more Array prototype methods added in ES2015 and beyond. You can safely use them without fear of breaking in older browsers. If it's more convenient you can also use their [Lodash](https://lodash.com/) equivalents. For example: - [`_.find`](https://lodash.com/docs/#find) ([`Array#find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)) - [`_.findIndex`](https://lodash.com/docs/#findIndex) ([`Array#findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex)) From 719ddb11356d75c8009a699297db2975407fb116 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Fri, 24 Aug 2018 01:07:26 -0400 Subject: [PATCH 2/3] Hide link url --- docs/coding-guidelines/javascript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/coding-guidelines/javascript.md b/docs/coding-guidelines/javascript.md index dc2fa8d322ac9..b1170f01330b1 100644 --- a/docs/coding-guidelines/javascript.md +++ b/docs/coding-guidelines/javascript.md @@ -594,7 +594,7 @@ We encourage you to make use of these methods in favor of traditional `for` and - [`Array#some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) - [`Array#every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) -As of https://github.com/Automattic/wp-calypso/pull/25419, Calypso includes polyfills for many more Array prototype methods added in ES2015 and beyond. You can safely use them without fear of breaking in older browsers. If it's more convenient you can also use their [Lodash](https://lodash.com/) equivalents. For example: +Calypso [now includes polyfills](https://github.com/Automattic/wp-calypso/pull/25419) for many more Array prototype methods added in ES2015 and beyond. You can safely use them without fear of breaking in older browsers. If it's more convenient you can also use their [Lodash](https://lodash.com/) equivalents. For example: - [`_.find`](https://lodash.com/docs/#find) ([`Array#find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)) - [`_.findIndex`](https://lodash.com/docs/#findIndex) ([`Array#findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex)) From b8ec0bb7685a21094c2efdfa5ebe30f92bf82837 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Fri, 24 Aug 2018 01:10:10 -0400 Subject: [PATCH 3/3] Slightly adjust wording --- docs/coding-guidelines/javascript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/coding-guidelines/javascript.md b/docs/coding-guidelines/javascript.md index b1170f01330b1..6ae44a7160edf 100644 --- a/docs/coding-guidelines/javascript.md +++ b/docs/coding-guidelines/javascript.md @@ -594,7 +594,7 @@ We encourage you to make use of these methods in favor of traditional `for` and - [`Array#some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) - [`Array#every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) -Calypso [now includes polyfills](https://github.com/Automattic/wp-calypso/pull/25419) for many more Array prototype methods added in ES2015 and beyond. You can safely use them without fear of breaking in older browsers. If it's more convenient you can also use their [Lodash](https://lodash.com/) equivalents. For example: +Calypso [includes polyfills](https://github.com/Automattic/wp-calypso/pull/25419) for many more Array prototype methods that were added in ES2015 and beyond. You can safely use them without fear of breaking older browsers. If it's more convenient you can also use their [Lodash](https://lodash.com/) equivalents. For example: - [`_.find`](https://lodash.com/docs/#find) ([`Array#find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)) - [`_.findIndex`](https://lodash.com/docs/#findIndex) ([`Array#findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex))