Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#14580 closed defect (wontfix)

"first Dojo wins" policy breaks in the built version

Reported by: riceyeh Owned by: Rawld Gill
Priority: low Milestone: tbd
Component: BuildSystem Version: 1.6.1
Keywords: Cc: bill
Blocked By: Blocking:


The dojo.js in source version has a policy "first Dojo wins". The policy breaks in its built version. This can be proven by where a loaded (through dojo.require) module by the first dojo is loaded again in the second dojo. Another discussion on this problem is

Attachments (1)

loadDojo.html (808 bytes) - added by riceyeh 10 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by bill

Component: GeneralBuildSystem
Owner: set to Rawld Gill

comment:2 Changed 10 years ago by Rawld Gill

Status: newassigned

If you reduce this to a small, reproduceable test case, I'll try to help.

Changed 10 years ago by riceyeh

Attachment: loadDojo.html added

comment:3 in reply to:  2 ; Changed 10 years ago by riceyeh

Attached is a file loadDojo.html which contains a dojox.layout.ContentPane? with href set to itself. A global variable is set to the pane to control whether to load itself. In source version, this html does not cause any error. In built version, this html cause 'Tried to register widget with id==dojox_layout_ContentPane_0 but that id is already registered' because the global variable does not work in second load.



<meta http-equiv="content-type" content="text/html; charset=utf-8"/> <style type="text/css">

@import "dijit/themes/claro/claro.css"; @import "dojo/resources/dojo.css";

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

dojo.require("dojo.parser"); dojo.require("dojox.layout.ContentPane?");


</head> <body class="claro">

<div data-dojo-type="dojox.layout.ContentPane?">

<script type="dojo/method">

if (! { = this.set("href", "loadDojo.html");






comment:4 in reply to:  3 Changed 10 years ago by riceyeh

I test the attachment on version 1.6.1. In 1.7.1, this problem has changed to ticket 14584.

comment:5 Changed 10 years ago by Rawld Gill

Cc: bill added
Priority: highlow

I don't understand the example. In the content pane, the href seems to load loadDojoLoop.html. What's in that file?

I'm also having trouble understanding the overall problem...both on this and #14584. Could you please expand a bit.

@bill: any ideas as to the real issue/what we should do with this and #14584?

comment:6 Changed 10 years ago by bill

loadDojoLoop.html is loading *the same file*, it loads itself, thus there are two <script src=dojo.js> "executed".

I don't consider this a real issue, I would probably mark them as wontfix. If you wanted to be nice you would put some checking code in dojo.js to do nothing if dojo was already defined.

comment:7 Changed 10 years ago by Rawld Gill

Resolution: wontfix
Status: assignedclosed

This does not seem to be a problem with 1.8. And, I think we'll leave v1.6 alone for the moment.

comment:8 Changed 10 years ago by Rawld Gill

In [29155]:

fixing dojo loader so that subsequent attempts to load dojo.js effectively result in a no-op; fixes #14584; refs #14580; !strict

Note: See TracTickets for help on using tickets.