{"id":3268,"date":"2011-08-05T09:59:00","date_gmt":"2011-08-05T17:59:00","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/?p=3268"},"modified":"2011-08-05T09:59:20","modified_gmt":"2011-08-05T17:59:20","slug":"primalforms-2011-slimmer-form-code","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2011\/08\/05\/primalforms-2011-slimmer-form-code\/","title":{"rendered":"PrimalForms 2011: Slimmer Form Code"},"content":{"rendered":"<p>In the latest service release (v2.0.11) we updated PrimalForm 2011\u2019s code generator so that it produces slimmer scripts. We wanted to increase the readability and at the same time reduce the size of the generated script. <\/p>\n<p>The following is a script block generated by the previous version of PrimalForms 2011:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/08\/Old-Generated-Script1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"Old Generated Script\" border=\"0\" alt=\"Old Generated Script\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/08\/Old-Generated-Script_thumb1.png\" width=\"504\" height=\"197\"><\/a><\/p>\n<p>Now we have the same script block generated by the latest version of PrimalForms 2011:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/08\/New-Generated-Script2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"New Generated Script\" border=\"0\" alt=\"New Generated Script\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/08\/New-Generated-Script_thumb2.png\" width=\"504\" height=\"156\"><\/a><\/p>\n<p>By utilizing PowerShell\u2019s ability to convert strings into appropriate objects, the generated code is now cleaner and easier to read. <\/p>\n<p>&nbsp;<\/p>\n<p>UPDATE: In the next service build, the generated script will get even slimmer by removing the DataBinding.DefaultDataSourceUpdateMode line of each control:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/08\/Generated-Script-Next-Build.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"Generated Script Next Build\" border=\"0\" alt=\"Generated Script Next Build\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/08\/Generated-Script-Next-Build_thumb.png\" width=\"504\" height=\"198\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the latest service release (v2.0.11) we updated PrimalForm 2011\u2019s code generator so that it produces slimmer scripts. We wanted to increase the readability and at the same time reduce the size of the generated script. The following is a script block generated by the previous version of PrimalForms 2011: Now we have the same [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[575,21,25],"tags":[28,633,447],"class_list":["post-3268","post","type-post","status-publish","format-standard","hentry","category-primalforms-2011-software-news","category-software-news","category-windows-powershell","tag-powershell","tag-primalforms-2011","tag-script"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/3268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=3268"}],"version-history":[{"count":11,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/3268\/revisions"}],"predecessor-version":[{"id":3289,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/3268\/revisions\/3289"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=3268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=3268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=3268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}