Opened 7 years ago

Closed 3 years ago

#14545 closed defect (invalid)

build system miss the dependencies declared in AMD's require() call

Reported by: helloworld Owned by: helloworld
Priority: high Milestone: 1.13
Component: BuildSystem Version: 1.7.1
Keywords: build system AMD require Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

In index.html, we have:

<script type="text/javascript" src="js/dojo/dojo.js" data-dojo-config="async:true, isDebug:true, parseOnLoad:true"></script>

<script type="text/javascript">


                require(["dojo/ready",                          /* This is for AMD style, instead of old style with dojo.require(), right? */

                        "dojo/parser",

                        "foo1/foo2/Bar", ...],                   /* some modules for my project  */

                        function(ready, parser, Bar, ...) {

                               read(function() {....})

Then run command below:

$./build.sh action=release htmlFiles=../../../index.html --check-args

Then there is nothing about "foo1/foo2/Bar" in output of profiles as below:

{

                action:"release",

                profiles:[{

                                         basePath:"/var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/util/buildscripts",

                                         defaultConfig:{hasCache:{}},

                                         layers:{},

                                         packages:[

                                                        {

                                                                        copyright:"",

                                                                        location:"/var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/dijit",

                                                                        name:"dijit",

                                                                        runtime:undefined

                                                        },

                                                        {

                                                                        copyright:"",

                                                                        location:"/var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/dojox",

                                                                        name:"dojox",

                                                                        runtime:undefined

                                                        },

                                                        {

                                                                        copyright:"/*\n\tCopyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.\n\tAvailable via Academic Free License >= 2.1 OR the modified BSD license.\n\tsee: http://dojotoolkit.org/license for details\n*/\n\n",

                                                                        location:"/var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/dojo",

                                                                        name:"dojo",

                                                                        runtime:undefined

                                                        }

                                         ],

                                         prefixes:[

                                                        [

                                                                        "dijit",

                                                                        "../dijit"

                                                        ],

                                                        [

                                                                        "dojox",

                                                                        "../dojox"

                                                        ]

                                         ],

                                         releaseDir:"/var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/release",

                                         releaseName:"dojo",

                                         staticHasFeatures:{}

                                }]

}

But if I add one line below,

 <script type="text/javascript" src="foo1/foo2/Bar.js"></script>

Then the output of build.sh will have something about "foo1/foo2/Bar".

So, seems dojo build system miss the dependencies declared in AMD's require() call.

Change History (11)

comment:1 Changed 7 years ago by helloworld

And this is output of command:


info(107) Package Version: package: dijit; version: 1.7.1

processing profile resource /var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/dijit/dijit.profile.js

info(107) Package Version: package: dojox; version: 1.7.1

processing profile resource /var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/dojox/dojox.profile.js

info(107) Package Version: package: dojo; version: 1.7.1

processing profile resource /var/lib/hudson/jobs/phototypeClient/workspace/client/src/js/dojo/dojo.profile.js

discovering resources...

starting reading resources...

starting processing raw resource content...

starting tokenizing resource...

starting processing resource tokens...

starting parsing resource...

starting processing resource AST...

warn(216) dojo/has plugin resource could not be resolved during build-time. plugin resource id: dojo-firebug?./_firebug/firebug; reference module id: dojo/main

warn(216) dojo/has plugin resource could not be resolved during build-time. plugin resource id: dom-addeventlistener?:./aspect; reference module id: dojo/on

starting executing global optimizations...

starting writing resources...

starting cleaning up...

starting reporting...

Report written to /var/lib/hudson/jobs/phototypeClient/workspace/client/release/foo/build-report.txt

Process finished normally.

errors: 0

warnings: 2

build time: 55.095 seconds

comment:2 Changed 7 years ago by Adam Peller

Component: GeneralBuildSystem
Description: modified (diff)
Owner: set to Rawld Gill
Summary: Dojo1.7.1 build system miss the dependencies declared in AMD's require() callbuild system miss the dependencies declared in AMD's require() call

comment:3 Changed 7 years ago by Rawld Gill

Status: newassigned

comment:4 Changed 7 years ago by Colin Snover

Priority: highblocker

Bulk update of open ticket priorities.

comment:5 Changed 7 years ago by Rawld Gill

Milestone: tbd1.8

comment:6 Changed 7 years ago by liucougar

a possible patch

  • build/v1xProfiles.js

    diff --git a/build/v1xProfiles.js b/build/v1xProfiles.js
    index 07c598d..6f51982 100644
    a b define([ 
    305305                                       // for each dojo.require call add it to the layers as well
    306306                                       addLayer(scriptName);
    307307                               });
     308                               html.replace(/require\s*\(\s*\[([^\]]+)\]/g, function(t, list){
     309                                       if(list.replace(/^\s*['"]/,' ').charAt(0)!==' '){
     310                                               //make sure the list starts with a string
     311                                               return;
     312                                       }
     313                                       list.replace(/['"]/g,'').split(/\s*,\s*/).forEach(addLayer);
     314                               });
    308315                       });
    309316
    310317                       var prefixPaths = [];

comment:7 Changed 7 years ago by Rawld Gill

Owner: changed from Rawld Gill to Kitson Kelly
Priority: blockerhigh

I think kitsonk has a build plugin to implement this functionality. In any event, this feature, while nice, is not a blocker. The work-around is to simply construct an explicit profile.

@kitsonk: I lost track of where the plugin status. Please let me know if you need something more from me.

comment:8 Changed 7 years ago by Kitson Kelly

The ticket for the transform is #15367 which looks like it will work for this.

@rcgill I have it mostly ready, need to look at it again because it still has one problem and if I can't figure it out I will ping you.

comment:9 Changed 7 years ago by Kitson Kelly

Milestone: 1.8future

Not sure if changes for #15367 will fully work for this, but no matter what, we can't put it into 1.8 because it is feature frozen, so moving to the future.

comment:10 Changed 3 years ago by dylan

Milestone: future1.12
Owner: changed from Kitson Kelly to helloworld
Status: assignedpending

I am curious to know if #15367 resolved this issue or not (was added to Dojo 1.9)

comment:11 Changed 3 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.