Quantcast

Need help with Dojo Build

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Need help with Dojo Build

Harry Devine

I have 2 sites that I maintain and they are very slow to load.  I currently have them working with Dojo, but I have the entire Dojo tree under /dojoroot in my webspace on the server.  I have been reading up on creating Dojo builds, but everything I've read gets very confusing very fast.  Is there a basic, "Dojo Builds for Dummies" like write up that I can refer to to make sense of getting a build started and successfully built?  Would creating a Dojo build for my site(s) make them load faster?


Thanks for any help!

Harry


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Rob Gillan-3
Harry,

Short answer is absolutely.  One of the problems you’re facing is that each individual file/module is being loaded by the browser and with any sort of application complexity this could be dozens even hundreds of files.  There is a tutorial on the website that’s pretty straight forward.  All you need to do is create your profile json file and run the command line.  The only gotcha we found is that there are a number of locale specific files that get pulled in by the browser that end up in dojo/cldr, dojo/nls and dojo/release that you’ll still need to keep in your root folder.  Once you load your build tools like Chrome debugger will quickly highlight which ones it’s trying to look for.  We typically copy the base files plus the language/locale sets we use (/en, /fr etc.).  You can easily include any of your own modules as well in the profile file and have them built/minified.

Try the tutorial first and feel free to reach out if you have any issues.

/r


On 6 Dec 2016, at 2:15 pm, Harry Devine <[hidden email]> wrote:

I have 2 sites that I maintain and they are very slow to load.  I currently have them working with Dojo, but I have the entire Dojo tree under /dojoroot in my webspace on the server.  I have been reading up on creating Dojo builds, but everything I've read gets very confusing very fast.  Is there a basic, "Dojo Builds for Dummies" like write up that I can refer to to make sense of getting a build started and successfully built?  Would creating a Dojo build for my site(s) make them load faster?


Thanks for any help!

Harry

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Harry Devine

So I'm reading through the tutorial here: http://dojotoolkit.org/documentation/tutorials/1.10/build/index.html.  In the "Laying Out Your Application" section, they recommend having a src directory, then underneath having app, dijit, etc.  I have the Dojo sources under there right now (I downloaded the source release for 1.11.2), but I'm confused on what goes under app.  Is it just my javascript modules?  Does my entire php sources for my site go there? 


My web app is structured like this:


  myapp

    class    (I have some PHP files here where I interact with my MySQL database)

    js          ( My apps custom dojo-like modules are here)

    images

    json      (I have some json files here that I use for populating Dijit Select controls as a store)

    css       (My apps CSS file)

   *.php    (all of my web app's PHP files)

   admin   (this folder is a separate application to handle the admin functions of the site.  Sort of an "admin.myapp.com" subdomain; it uses the javascript files under /myapp/js, the class files under /myapp/class, etc.)


So based on that, how do I layout the build folder so I can try and get this built?  Another question I have, which is probably my putting the cart before the horse, is what do I put into the package.json file?  Just the Dojo modules that my custom modules included for them to function?


Thanks!

Harry

On December 5, 2016 at 10:21 PM Rob Gillan <[hidden email]> wrote:

Harry,

Short answer is absolutely.  One of the problems you’re facing is that each individual file/module is being loaded by the browser and with any sort of application complexity this could be dozens even hundreds of files.  There is a tutorial on the website that’s pretty straight forward.  All you need to do is create your profile json file and run the command line.  The only gotcha we found is that there are a number of locale specific files that get pulled in by the browser that end up in dojo/cldr, dojo/nls and dojo/release that you’ll still need to keep in your root folder.  Once you load your build tools like Chrome debugger will quickly highlight which ones it’s trying to look for.  We typically copy the base files plus the language/locale sets we use (/en, /fr etc.).  You can easily include any of your own modules as well in the profile file and have them built/minified.

Try the tutorial first and feel free to reach out if you have any issues.

/r


On 6 Dec 2016, at 2:15 pm, Harry Devine <[hidden email]> wrote:

I have 2 sites that I maintain and they are very slow to load.  I currently have them working with Dojo, but I have the entire Dojo tree under /dojoroot in my webspace on the server.  I have been reading up on creating Dojo builds, but everything I've read gets very confusing very fast.  Is there a basic, "Dojo Builds for Dummies" like write up that I can refer to to make sense of getting a build started and successfully built?  Would creating a Dojo build for my site(s) make them load faster?


Thanks for any help!

Harry

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


 

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Rob Gillan-3
Harry,

Basically what we ended up with is the standard dojo folder structure (/dojo, /dijit, /dojox, /dstore, /dgrid, /yourown) where you put them in your application folder structure, although the main dojo.js file is replaced as a “layer” in the build, plus any locale files as mentioned.  You’ll need to adjust this for your own build layout, but for reference the profile.js file is where it all happens.  Here’s one of the ones we used with 1.11 (we haven’t done the 1.12 build yet),  Hope this helps


var profile = (function(){
        return {
                basePath: "./",
                releaseDir: "./release/build",
                releaseName: "elements",
                action: "release",
                layerOptimize: "closure",
                optimize: "closure",
                cssOptimize: "comments",
                mini: true,
                stripConsole: "warn",
                selectorEngine: "lite",

                defaultConfig: {
                        hasCache:{
                                "dojo-built": 1,
                                "dojo-loader": 1,
                                "dom": 1,
                                "host-browser": 1,
                                "config-selectorEngine": "lite"
                        },
                        async: 1
                },

                staticHasFeatures: {
                        "config-deferredInstrumentation": 0,
                        "config-dojo-loader-catches": 0,
                        "config-tlmSiblingOfDojo": 0,
                        "dojo-amd-factory-scan": 0,
                        "dojo-combo-api": 0,
                        "dojo-config-api": 1,
                        "dojo-config-require": 0,
                        "dojo-debug-messages": 0,
                        "dojo-dom-ready-api": 1,
                        "dojo-firebug": 0,
                        "dojo-guarantee-console": 1,
                        "dojo-has-api": 1,
                        "dojo-inject-api": 1,
                        "dojo-loader": 1,
                        "dojo-log-api": 0,
                        "dojo-modulePaths": 0,
                        "dojo-moduleUrl": 0,
                        "dojo-publish-privates": 0,
                        "dojo-requirejs-api": 0,
                        "dojo-sniff": 1,
                        "dojo-sync-loader": 0,
                        "dojo-test-sniff": 0,
                        "dojo-timeout-api": 0,
                        "dojo-trace-api": 0,
                        "dojo-undef-api": 0,
                        "dojo-v1x-i18n-Api": 1,
                        "dom": 1,
                        "host-browser": 1,
                        "extend-dojo": 1
                },

                packages:[{
                        name: "dojo",
                        location: "dojo"
                },{
                        name: "dijit",
                        location: "dijit"
                },{
                        name: "dojox",
                        location: "dojox"
                },{
                        name: "dgrid",
                        location: "dgrid"
                },{
                        name: "dstore",
                        location: "dstore"
                },{
                        name: "nisient",
                        location: "nisient"
                }],

                layers: {
                        "dojo/dojo": {
                                include: [
                                        'dojo/_base/array',
                                        'dojo/_base/kernel',
                                        'dojo/_base/connect',
                                        'dojo/_base/declare',
                                        'dojo/_base/lang',
                                        'dojo/aspect',
                                        'dojo/date',
                                        'dojo/date/stamp',
                                        'dojo/date/locale',
                                        'dojo/dom',
                                        'dojo/dom-attr',
                                        'dojo/dom-class',
                                        'dojo/dom-construct',
                                        'dojo/dom-style',
                                        'dojo/domReady',
// 'dojo/has',
                                        'dojo/number',
                                        'dojo/on',
                                        'dojo/parser',
                                        'dojo/query',
                                        'dojo/ready',
                                        'dojo/request',
                                        'dojo/sniff',
                                        'dojo/touch',
                                        'dojo/window',
                                        'dijit/Dialog',
                                        'dijit/form/Button',
                                        'dijit/form/CheckBox',
                                        'dijit/form/DateTextBox',
                                        'dijit/form/Form',
                                        'dijit/form/MultiSelect',
                                        'dijit/form/NumberTextBox',
                                        'dijit/form/RadioButton',
                                        'dijit/form/Select',
                                        'dijit/form/Textarea',
                                        'dijit/form/TextBox',
                                        'dijit/form/TimeTextBox',
                                        'dijit/form/ValidationTextBox',
                                        'dijit/layout/BorderContainer',
                                        'dijit/layout/ContentPane',
                                        'dijit/layout/StackContainer',
                                        'dijit/layout/TabContainer',
                                        'dijit/popup',
                                        'dijit/ProgressBar',
                                        'dijit/registry',
                                        'dijit/TooltipDialog',
                                        'dojox/calendar/Calendar',
                                        'dojox/validate/_base',
                                        'dojox/validate/creditCard',
                                        'dojox/validate/isbn',
                                        'dojox/validate/web',
                                        'dojox/widget/FisheyeList',
                                        'dojox/widget/FisheyeListItem',
                                        'dojox/widget/Standby',
                                        'dojox/widget/MonthAndYearlyCalendar',
                                        'dgrid/OnDemandGrid',
                                        'dgrid/CellSelection',
                                        'dgrid/extensions/DijitRegistry',
                                        'dgrid/Selection',
                                        'dgrid/util/misc',
                                        'dgrid/util/touch',
                                        'dstore/Memory',
                                        'dstore/Trackable'
                                        ],
                                customBase: true,
                                boot: true
                        }
                }
        };
})();
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Harry Devine
I have taken my first attempt and used some profiles I've seen online, and I have a bunch of errors. Here's what I have:

application.profile.js:

var profile = {
    basePath: '.',
    releaseDir: '../app',
    action: 'release',
    cssOptimize: 'comments',
    mini: true,
    optimize: 'closure',
    layerOptimize: 'closure',
    stripConsole: 'none',
    selectorEngine: 'acme',
    packages: [
        {name: 'dojo', location: 'dojo'},
        {name: 'dijit', location: 'dijit'},
        {name: 'dojox', location: 'dojox'},
        {name: 'util', location: 'util'},
        {name: 'app', location: 'app'}
    ],

    layers: {
        'dojo/dojo': {
            include: ['dojo/i18n', 'dojo/domReady'],
            boot: true,
            customBase: true
        },
        'app/app': {}
    },
    staticHasFeatures: {
        'dojo-trace-api': 0,
        'dojo-log-api': 0,
        'dojo-publish-privates': 0,
        'dojo-sync-loader': 0,
        'dojo-xhr-factory': 0,
        'dojo-test-sniff': 0
    }
};

app.profile.js:

var profile = {
resourceTags: {
    test: function (filename, mid) {
        return false;
    },
    copyOnly: function (filename, mid) {
        return (!/\.js$/.test(filename) && !/\.css$/.test(filename));
    },
    amd: function (filename, mid) {
        return !this.copyOnly(filename, mid) && /\.js$/.test(filename);
    },

    miniExclude: function (filename, mid) {
        return mid in {
            'app/package': 1
        }
    }
}};

package.json:

{
    "name": "app",
    "description": "My Application.",
    "version": "1.0",
    "keywords": ["JavaScript", "Dojo", "Toolkit", "DojoX"],
    "maintainers": [{
        "name": "Harry Devine"
    }],
    "contributors": [{
        "name": "Harry Devine"
    }],
    "dependencies": {
        "dojo": "~1.11.2",
        "dijit": "~1.11.2",
        "dojox": "~1.11.2"
    },
    "main": "src",
    "homepage": "http://mysite.com/",
    "dojoBuild": "app.profile.js"
}

I get the following errors:
error(306) Failed to evaluate legacy API application.
        module: util/buildscripts/jslib/i18nUtil; text: ReferenceError: moduleName is not defined; error: dojo.requireLocalization(moduleName, bundleName, localeName);

error(311) Missing dependency.

I also get a bunch of errors as follows (maniacsFunctions.js is my custom module):
maniacsFunctions.js.uncompressed.js:46: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.

Thanks for any help!
Harry

> On December 7, 2016 at 3:44 AM Rob Gillan <[hidden email]> wrote:
>
>
> Harry,
>
> Basically what we ended up with is the standard dojo folder structure (/dojo, /dijit, /dojox, /dstore, /dgrid, /yourown) where you put them in your application folder structure, although the main dojo.js file is replaced as a “layer” in the build, plus any locale files as mentioned.  You’ll need to adjust this for your own build layout, but for reference the profile.js file is where it all happens.  Here’s one of the ones we used with 1.11 (we haven’t done the 1.12 build yet),  Hope this helps
>
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Harry Devine
In reply to this post by Rob Gillan-3

I tried your profile below, and I still get errors, and no build.  Obviously I'm missing something basic.  I've read the tutorial several times and I can't make heads or tails of it.  I need a SUPER basic overview of how this process is supposed to work.  Here's an example of what I mean:


in my module, called maniacsFunctions.js, I have a declaration at the top as follows:


....

], function(registry, Menu, MenuBar, MenuBarItem, PopupMenuBarItem, DropDownMenu, MenuItem, PopupMenuItem, ContentPane,Select, declare, arrayUtil, query, RequestMemory, Observable, Memory, ItemFileReadStore, request, on, dom,
domConst, domAttr, domClass, domStyle, locale, stamp, topic, has, Calendar, ThumbnailPicker, Gallery, Grid, Pagination,
ColumnResizer, DijitRegistry, Selection) {

return {

calendarVisibility: [true, true, true, true],

......


During the build, I get the following error pertaining to the calendarVisibility line:


maniacsFunctions.js.uncompressed.js:46: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.
calendarVisibility: [true, true, true, true],
^


What is wrong with that line?  Makes no sense to me.  Also, there are errors for missing dependencies and missing include modules for dojo layers, all of which are the standard dojo modules.  I'm just totally lost and have NO IDEA where to start or look to figure this process out.  


Please help!  I can take my dojo build area, tar it up and send it to someone, or at least send the build-report.txt file if someone would care to look at it.  But at this point, this process, in my mind, is totally broken and not usable.


Thanks,

Harry

On December 7, 2016 at 3:44 AM Rob Gillan <[hidden email]> wrote:

Harry,

Basically what we ended up with is the standard dojo folder structure (/dojo, /dijit, /dojox, /dstore, /dgrid, /yourown) where you put them in your application folder structure, although the main dojo.js file is replaced as a “layer” in the build, plus any locale files as mentioned. You’ll need to adjust this for your own build layout, but for reference the profile.js file is where it all happens. Here’s one of the ones we used with 1.11 (we haven’t done the 1.12 build yet), Hope this helps


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Arnd Beissner

return {

calendarVisibility: [true, true, true, true],

During the build, I get the following error pertaining to the calendarVisibility line:

maniacsFunctions.js.uncompressed.js:46: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.

calendarVisibility: [true, true, true, true],

Well, it just says than in IE8 (and below) you will have an issue with the trailing comma in that line (because IE8). It then advises you to turn that error off by using the language_in option.

This option is an option of the Google Closure compiler. The Dojo build system uses Google Closure for JS optimization/minification. However, in this case it could be that you get this error because you run the Dojo Build using Rhino on Windows instead of Node.js. And you get this error because Rhino tells Closure that it is in the IE8 ballpark of JS runtimes.

So either get rid of that (correct) trailing comma or set the language_in option (see https://github.com/google/closure-compiler). Or this problem might also go away if you run the build with Node.js.

Pieces of advice:

> I have taken my first attempt and used some profiles I've seen online, and I have a bunch of errors.

Don’t do that (the „used some profiles I’ve seen online“ part). The Dojo build system has evolved and especially once you start using module mapping you end up in a world of pain if you use accidentally user legacy mechanisms.

I really recommend reading http://dojotoolkit.org/documentation/tutorials/1.10/build/index.html thoroughly and to start from there. It still is complex. If you cannot invest that time, it’s better to get someone to set up the build with its options for you.

Start with a minimal build configuration (not someone else’s copied over) that you construct based on the tutorial. And do not use more than one layer unless you really need to.

Hope this helps,
-- 
Arnd Beißner


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Harry Devine

Would it be worth my sending, at the very least, my applications module along to see if there's any issues with it to start off with?  I have 36 dojo elements that I include in my module for various uses of it, so I created a appl;ication.profile.js to have 1 layer with those 36 dojo elements.  I get errors that my module isn't pure AMD (the error is: error(307) failed to evaluate module tagged as pure amd).  Perhaps that's a good place to start to attempt to tackle the misunderstandings that I'm having?


I also noticed how you mentioned that the tutorial is complex.  I understand that.  What I'd like is for someone to make it NOT complex.  I'm sure that hundreds or thousands of Dojo developers are making their own builds, so something "clicked" for them to make them understand.  I would like to have it explained to me, not just by reading the tutorial that I've read at least 10 times already, by someone who can make me see the areas that I'm not getting.


Thanks!

Harry

On December 12, 2016 at 10:32 AM Arnd Beissner <[hidden email]> wrote:

return {

calendarVisibility: [true, true, true, true],

During the build, I get the following error pertaining to the calendarVisibility line:

maniacsFunctions.js.uncompressed.js:46: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.

calendarVisibility: [true, true, true, true],

Well, it just says than in IE8 (and below) you will have an issue with the trailing comma in that line (because IE8). It then advises you to turn that error off by using the language_in option.

This option is an option of the Google Closure compiler. The Dojo build system uses Google Closure for JS optimization/minification. However, in this case it could be that you get this error because you run the Dojo Build using Rhino on Windows instead of Node.js. And you get this error because Rhino tells Closure that it is in the IE8 ballpark of JS runtimes.

So either get rid of that (correct) trailing comma or set the language_in option (see https://github.com/google/closure-compiler). Or this problem might also go away if you run the build with Node.js.

Pieces of advice:

> I have taken my first attempt and used some profiles I've seen online, and I have a bunch of errors.

Don’t do that (the „used some profiles I’ve seen online“ part). The Dojo build system has evolved and especially once you start using module mapping you end up in a world of pain if you use accidentally user legacy mechanisms.

I really recommend reading http://dojotoolkit.org/documentation/tutorials/1.10/build/index.html thoroughly and to start from there. It still is complex. If you cannot invest that time, it’s better to get someone to set up the build with its options for you.

Start with a minimal build configuration (not someone else’s copied over) that you construct based on the tutorial. And do not use more than one layer unless you really need to.

Hope this helps,
-- 
Arnd Beißner


 

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

Arnd Beissner

Would it be worth my sending, at the very least, my applications module along to see if there's any issues with it to start off with?  I have 36 dojo elements that I include in my module for various uses of it, so I created a appl;ication.profile.js to have 1 layer with those 36 dojo elements.  I get errors that my module isn't pure AMD (the error is: error(307) failed to evaluate module tagged as pure amd).  Perhaps that's a good place to start to attempt to tackle the misunderstandings that I'm having?

This usually isn’t a matter of a few minutes, and it usually isn’t worth starting without the complete project because the root cause for a problem can well be a certain module in your project. From my side the only further help I can give before Christmas is to advise to try building with Node.js instead of the Rhino build. The above error again sounds a bit like a Rhino build specific problem. 

 I would like to have it explained to me, not just by reading the tutorial that I've read at least 10 times already, by someone who can make me see the areas that I'm not getting.

I would have liked that, too. Unfortunately, it’s not just the build system that is complex, the stuff that goes on inside is complex, too. The same applies to people using Webpack with other frameworks. Use a very simple project with only a few modules to start. This should be easy to do with the tutorial and it should work out of the box. At least with the Node.js build. Do NOT use examples that you copied over. Do NOT introduce properties that you read about unless needed. Try if the Dojo boilerplate (https://github.com/csnover/dojo-boilerplate) works for you - it’s supposed to be updated to 1.10 at least, and the build profile in there is very well documented. If it does, adapt that build to your project.

I will try a very short summary, though: the basic concept is always this:

1) Specify the toplevel paths that you have
2) Let the build system resolve all dependencies
3) The build system concatenates all AMD modules that it finds into a single JS file (except if you use multiple layers)
4) The whole mechanism of defining and requiring modules changes from actual loading and caching to just inserting functions into a cache (the actual mechanism is surprisingly complex, though)
5) Now that you have on single JS file for each layer, Google Closure is called to optimize/minify the whole thing.

There are a lot of side stories to this like the dojo/text! special case that can include text resources into variables (used for template based widgets, for example).

So your source code is actually transformed and modified in a number of ways and places. Making it easy for things to break. If you are already aware of these basics, then I’m afraid the detail level of the tutorial is the logical next layer of understanding.
-- 
Arnd Beißner


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with Dojo Build

neekfenwick
In reply to this post by Harry Devine
On 07/12/16 19:49, Harry Devine wrote:
> I get the following errors:
> error(306) Failed to evaluate legacy API application.
> module: util/buildscripts/jslib/i18nUtil; text: ReferenceError: moduleName is not defined; error: dojo.requireLocalization(moduleName, bundleName, localeName);
>
> error(311) Missing dependency.

I can't see anything immediately wrong with your build setup but of
course there's a lot of fine detail not provided here.  You might have
to sprinkle console.log() statements in the buildscripts/jslib/i18nUtil
script to print exactly what it's doing, or hook it up to a debugger
like Webstorm (good luck with that).  It looks like whatever is calling
requireLocalization is passing in undefined as the modulename argument
so you'll have to look up the call stack for what's going wrong, but the
bundlename and locale arguments will also be useful.

It's fairly common to find that a codebase that worked fine before a
build fails to even build, because there were path references or coding
errors that the browser runtime was able to figure out, but the build
scripts fail to find.

> I also get a bunch of errors as follows (maniacsFunctions.js is my custom module)
> maniacsFunctions.js.uncompressed.js:46: ERROR - Parse error. IE8 (and below) will parse trailing commas in array and object literals incorrectly. If you are targeting newer versions of JS, set the appropriate language_in option.

I started seeing these errors after moving up from 1.10.x.  Have a look
in build-output.txt in your output folder, it should contain more
detailed error messages.  Most likely you actually do have a trailing
comma somewhere that it is pointing out to you by line number and you
can track down.  Search not only in the body of the output (regex like
"[^0] error" and also at the bottom of the build-output.txt there is
sometimes useful information.

Nick
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...