Understanding PeopleTools Minified JavaScript

At runtime, PeopleTools minifies any JavaScript code stored within an HTML definition so that the JavaScript runs more efficiently on the web server. This is the default runtime behavior. JavaScript that has been minified has been stripped down to only the essential strings required for runtime execution. It runs in this compressed, or minified, format to save bandwidth.

Knowing that the JavaScript will be minified at runtime enables developers to more freely add comments and formatting to code, making it easier to understand during design time, without introducing processing overhead at runtime.

During “minification”, PeopleTools removes the following items from JavaScript code within HTML definitions:

  • comments

  • most extraneous white space

  • most carriage returns

  • most tabs

If during testing or debugging you need to examine the web server cache, note that JavaScript files stored in the web server cache follow a different naming convention depending on whether they are in a minified format. For example, JavaScript in the minified format contains a MIN in the filename. For example:

PT_ACE_SERVICE_win0_MIN_4.js

PT_ACE_SCROLL_MIN_1.js

The same JavaScript that has not been minified has the following filenames:

PT_ACE_SERVICE_win0_4.js

PT_ACE_SCROLL_1.js

By default, PeopleTools runs JavaScript in minified mode on the web server. For development or debugging tasks, you can disable the default runtime mode for an entire PIA domain or for the current user. In general, if you are including custom JavaScript, it is recommended that you make sure it runs in unminified and minified modes. Errors as a result of minification typically generate messages in the application server log similar to:

JavaScript Minification: Found an unterminated regular expression set in <HTML Definition Name> set in <line number>.

Note:

PeopleTools only minifies JavaScript contained in HTML Definitions.