...
The full Dojo 1.9 source is distributed as part of the common-ui plugin and made available through common-ui's RequireJS configuration for anyone to use.
Migrating custom Pentaho solutions based on Dojo in 5.1
If you've built Platform Plugins based on the older version of Dojo that we used to ship, you'll have to migrate your code to work with the new AMD loader syntax. The Dojo foundation has a very comprehensive guide on how to migrate from the old Dojo loader and syntax to AMD here: Dojo 2.0 Migration.
Note: You do not have to include dojo.js in your page as described in their migration guide. We use the RequireJS loader instead which is available on any page which includes the webcontext.js script. AMD Javascript Modules (RequireJS)#webcontext
RequireJS "pen." Namespace Deprecated
Prior to 5.1 we had to namespace the RequireJS "require" and "define" functions as "pen.require" and "pen.define". This was done to avoid conflict with the older 1.6. Dojo. This conflict has been eliminated in 5.1. You can now use the standard "require" and "define" functions per the AMD spec. The "pen.*" form will continue to function to maintain backwards compatibility with existing scripts.
RequireJS Optimizer Build
...