Unless you live under a rock (or have had the incredibly good sense to avoid Twitter), you know that today we announced the public betas of ColdFusion Splendor (that's the next version of the server) and ColdFusion Thunder (the IDE).
You can grab the bits here: http://labs.adobe.com/technologies/coldfusion/
Unfortunately there isn't a cool logo for the betas but as I've said for a while now that the code names sound like 1980s X-Men, I'm going with this until Adobe Legal or Marvel tells me otherwise:
So first off, some tips. Want to quickly see what's new? Go here: New in ColdFusion. A more focused list is here: CFML Reference - New in Splendor.
So what am I excited about? Here are a few things in no particular order.
The Getting Started Server
This is a new way to try out ColdFusion. Just download, unzip, and run. No installation necessary. You can find docs here. Speaking of the docs - this tripped up both Adam Cameron and me. The default password for the Admin is... admin. The text file that includes the password properties shows a blank value, but apparently the logic is "if blank, use admin", which wasn't something I'd guess.
Script Support for Tags
About. Damn. Time. So every single possible thing now is available in script. Even cfheader. Even custom tags. As an example:
header(name="Access-Control-Allow-Origin" value="*");
QueryExecute
Ok, frankly, I didn't mind the "Query as a CFC" thing we had in CF9 and 10. It matched how other languages handled queries. Yes it was verbose, but honestly it didn't bug me. That being said, yeah, I'm never using it again. Now you can just use queryExecute.
queryExecute("select beer from bar where country=:country and type=:type", {country:'USA', type:'IPA'});
JSON Updates
There were a few changes here. First, structs now will preserve their case when you serialize to JSON. Nice. Second, CF will preserve the type for queries. This has been an issue for a while. In fact, I highly recommend Ben's JSONSerializer as a way to completely bypass JSON serialization in ColdFusion 10. (Well, if you run into issues of course.) It looks like this may finally(?) be licked in Splendor. Please check it out.
Finally, the way ColdFusion serializes queries has been updated to support a new struct form. The docs specifically call out jQuery (sigh), but obviously this applies to ANY JavaScript code. Here is an example output with the new form.
[
{"colour":"red","id":1},
{"colour":"green","id":2},
{"colour":"blue","id":3}
]
You can read about the above changes here.
One more quick note. The REST Enhancements docs talk about how you can customize the serializer/deserializer. This is NOT for REST only! I just did a test where I simply ran serializeJSON on a CF variable in a simple CFM and my custom serializer was used.
Member Functions
So yeah... do you find yourself typing somearr.length() instead of arrayLen(somearr.length)? Now you can do somearr.len(). Member functions have been added all over the place - for arrays, strings, lists, structs, dates, images, spreadsheets, XML objects, and queries.
QueryGetRow
How many times have I written code to loop over the first row of a one row query to turn it into a struct? Too many times. Done.
DDX - 100%
Ok, DDX isn't sexy but I thought it was a cool feature even when it was limited. Now it isn't. Awesome.
Oh, and...
I've been very public about not being a fan of ColdFusion Builder. I think it is an incredible tool and a great IDE. But I'm doing much more client-side development lately and CFB hasn't been very good for that. I can say the new version actually does HTML/JS pretty darn good. Is it enough to make me switch? Probably not. But I currently use Sublime for ColdFusion and I may stop and return to CFB when working with ColdFusion. It is still Eclipse - which roughly feels like the 40-year-old guy at the college bar trying to look cool - but I'm going to give it a shot.
Archived Comments
I had to write some Python lately and queryExecute looks very familiar to that syntax. I definitely like writing queries that way.
These enhancements/changes look great! They really seem to be listening to the CF community on what we want.
queryExecute() in particular I like but don't see a similar improvement for doing storedprocs in script.
Well, you can do it in script now - that's an improvement, right? :)
You forgot to mention CFClient :)
Heh.
I assume you are replying to me Ray? Yes, but it's every bit as kludgy as the cfquery script version was, so I always avoid it. I just keep all my storedprocs in their own DAO components so it's not a big deal. Just surprised they left it out!
Sorry no - it was to the comment about cfclient. ;)
So wait - the stored proc thing - it uses a CFC too, right? Can't you switch to the new script version?
I meant this comment:
"Well, you can do it in script now - that's an improvement, right? :)"
Not sure what you mean in your latest comment. Yes, you can do a storedproc in script, in CF10. It's just not very elegant, similar to the query version in CF10 where it takes up a bunch of lines to do a simple call. I would have liked to have seen a similar tag to the new queryExecute that would be as streamlined.
Mary, this blog post is about *Splendor* though. My point was that it should be simpler in the new 'script as tags' support, right?
http://help.adobe.com/en_US...
Mary... I'm not sure what you are saying here. Yes, I know how it is in 9/10. This post is about Splendor. My point was that in *Splendor* it may be better with the tags in script support. I'm not talking about the *current* CFCs.
You get that - right? That I mean Splendor, not what is there *now*.
Ah I see what you're saying Ray. I'll have to read more about what that really means, if that's the case I'd wonder why they would have needed to add the queryExecute then.
I'm Mary Jo BTW - two word first name ;-) Just to confuse people (and computer systems!)
Ah found it, yes, that is indeed an improvement! Cool! That fixes the biggest issue I had with the CF9/10 script version of storedproc which was how unreadable and verbose it was.
I'll still be hoping they add a storedproc version of the queryExecute though. ;-)
Not too late to file an ER!
DDX - 100%? What is that?
It lets you to stuff to PDF files - more complex than usual. It has been around since CF8 and I've blogged on it a few times. It currently ships with a few limits.
Re: ER Request
Just point me in the direction to do that! ;-)
Same place as usual - https://bugbase.adobe.com.
Good news, I have been off twitter for a week - this is what I missed :)
Ray, how do we submit documentation bugs? It's no wonder so many people have so many horrible impressions about CF. Look at how bad the documentation is just in one little snippet (And it's like this everywhere). The unnecessary pound signs all over the place; Inconsistent quoting. REALLOCATING THE DAMN INNER VARIABLE IN A LOOP IN STRING CONCATENATION!!!!
If we want people to take CF seriously, then maybe the people writing the documentation should as well.
<cfif #type# eq "XML">
<cfif isStruct(#arg#)>
<cfset var result = "<root>">
<cfset var key = "">
<cfloop collection=#arg# item="key">
<cfset var result = result & "<" & #key# & ">">
<cfset var result = result & serializeXML(#arg[key]#, true)>
<cfset var result = result & "</" & #key# & ">">
</cfloop>
<cfset var result = result & "</root>">
<cfreturn result>
Well, for docs, it is a wiki. You can request access to edit, or leave a comment about the mistake. To file a bug about the server, it is the usual place (bugbase).
OOps, forgot Bubase was for FR too... Added!
I couldn't resist entering the isvalid('integer') issue that they've refused to fix for years again too....seeing as they just closed it before without even fixing it.