cfdocs icon indicating copy to clipboard operation
cfdocs copied to clipboard

CF2021 New Functions / Features / Improvements

Open shawnoden opened this issue 4 years ago • 10 comments

CF2021 has a bunch of changes and improvements that need to be documented here. This could easily become its own project, since there are far too many changes for a single Issue. I'm throwing this up here as kind of a bookmark.

Adobe lists the New And Changed Functions at https://helpx.adobe.com/coldfusion/cfml-reference/new-changed-functions-coldfusion-2021.html

Several of the Improvements, like Identity Operators, Dynamic Switch/Case or Rest/Spread, could probably benefit from their own Guides.

For the new / changed functions:

Tags added to CFScript:

  • ~SaveContent~ #1408

String Functions:

  • ~StringSort~ #1410
  • ~StringSome~ #1410
  • ~StringReduce~ #1410
  • ~StringMap~ #1410
  • ~StringFilter~ #1410
  • ~StringEvery~ #1410
  • ~StringEach~ #1410

Encryption Functions:

  • ~GenerateBCryptHash~ #1411
  • ~GenerateSCryptHash~ #1411
  • ~VerifyBCryptHash~ #1411
  • ~VerifySCryptHash~ #1411
  • ~Encrypt/Decrypt/EncryptBinary/DecryptBinary - Added support for authentication encryption~ #1413

Encoding:

  • ~BinaryEncode/BinaryDecode - Added Base64Url encoding~ #1413

Structs:

  • ~StructIsCaseSensitive~ #1410
  • ~StructNew - added two new struct types (ordered-casesensitive, casesensitive)~ #1427

Arrays:

  • ~ArrayPush~ #1408
  • ~ArrayPop~ #1408
  • ~ArrayShift~ #1408
  • ~ArrayUnShift~ #1408

New ReduceRight methods:

  • ~ArrayReduceRight~ #1412
  • ~StringReduceRight~ #1412
  • ~ListReduceRight~ #1412

Time zone functions

  • ~GetTimeZone~ #1408
  • ~SetTimeZone~ #1408
  • ~ClearTimeZone~ #1408

New flags and features in Application.cfc

  • this.timeZone
  • MongoDB settings
  • AWS features
  • SAML features
  • Azure features (also verify enhancements made in CF2018) (https://helpx.adobe.com/coldfusion/cfml-reference/application-cfc-reference/application-variables.html)

Replace/ReplaceNoCase

  • added CallBack support
  • new parameter - "start" https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-m-r/replace.html

QueryFilter

  • new parameters
    • parallel
    • maxThreadCount
  • Also changes to not mutate original query object. https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-m-r/queryfilter.html

New member functions

  • Any.toJSON()

  • arrayObj.containsNoCase()

  • Sort Member functions accept compare/compareNocase as callback

    • https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-a-b/arraysort.html
    • https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-l/listsort.html
    • https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-s/structsort.html
    • ??? https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-m-r/querysort.html
  • also review changes since CF2018 https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-applications/using-the-member-functions.html

I may have missed some. If so, please feel free to edit my list.

shawnoden avatar Dec 01 '20 17:12 shawnoden

Thanks for putting this together @shawnoden

pfreitag avatar Dec 01 '20 17:12 pfreitag

Adobe added quite a bit in CF2021. :-)

shawnoden avatar Dec 01 '20 19:12 shawnoden

that queryfilter change is the right move but could really change the meaning of existing code

softwareCobbler avatar Feb 12 '21 16:02 softwareCobbler

that queryfilter change is the right move but could really change the meaning of existing code

How? This is a change in functionality that Adobe added in CF2021. It seems that the queryFilter function itself may have changed to not mutate the original query, but I haven't tested any of this yet. Adobe added new parameters to the function and also added a JVM flag that seems to maintain the old behavior. Is this what you're referring to? Regardless, this is probably one of the version changes that either is or should be highlighted. I haven't checked yet to see if it's in the Adobe change docs.

shawnoden avatar Feb 12 '21 16:02 shawnoden

existing code may rely on the in-place mutation of the query.

softwareCobbler avatar Feb 12 '21 18:02 softwareCobbler

existing code may rely on the in-place mutation of the query.

Any major release can contain breaking changes. This is not the first time ColdFusion has done this, and it won't be the last. This is why developers must have comprehensive test suites and hopefully these changes are mentioned in the release notes. At least when they make these changes, they offer a way to retain the old functionality, in this case with a JVM flag.

I wouldn't even say that's the most breaking change in the 2021 release. That would probably go to the date mask change,

KamasamaK avatar Feb 13 '21 17:02 KamasamaK

Please add all the new SAML-related functions to the "to do" list for CF 2021 updates. Ironically they are not even listed on the Adobe's new/changed function page listed in the original issue description here. The following page lists them: https://helpx.adobe.com/coldfusion/using/saml-coldfusion.ug.html

technomaz avatar Apr 26 '21 20:04 technomaz

I'm churning through these and marking them off as I PR the changes. structNew needs some more work. That one has a fun signature.

shawnoden avatar Oct 13 '21 21:10 shawnoden

@KamasamaK - do you think this is ok to close after your PR #1498 ?

pfreitag avatar May 12 '22 17:05 pfreitag

I didn't look at addressing "New flags and features in Application.cfc" or see what's already been done. The rest seems to be done.

KamasamaK avatar May 12 '22 17:05 KamasamaK

Updated New flags and features in Application.cfc.

Probably should create new guides for the AWS, Azure, SAML and MongoDB features. I updated the this. params in Application.cfc for SAML and MongoDB, but didn't add any further details about the functionality those flags allow. And the AWS and Azure flags are more complicated than just a this. flag.

The use of those is a bit beyond my experience and my ability to test. If anyone else can take those to flesh them out, that would be great.

Other than that, I believe the rest of this ticket is complete now.

shawnoden avatar Oct 20 '22 23:10 shawnoden

yay, thanks to everyone who helped out on this one!!

pfreitag avatar Oct 21 '22 13:10 pfreitag