Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13278 closed defect (fixed)

Wrong define in dojox/timing/_base.js

Reported by: Marc Durocher Owned by: Adam Peller
Priority: high Milestone: 1.7
Component: Dojox Version: 1.7.0b1
Keywords: ttrenka Cc:
Blocked By: Blocking:

Description

dojox/timing/_base.js starts with

define(dojo/_base/lang?, function(dojo){

dojo.experimental("dojox.timing");

-> dojo.experimental is not a function

the file should start with

define(dojo/_base/kernel?, function(dojo){

dojo.experimental("dojox.timing");

Change History (6)

comment:1 Changed 8 years ago by Adam Peller

Keywords: ttrenka added
Milestone: tbd1.7

comment:2 Changed 8 years ago by Adam Peller

lang already pulls in kernel, and lang is needed here, too. I see the experimental error either way.

comment:3 Changed 8 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [25574]) add kernel reference for experimental. Fixes #13278

comment:4 Changed 8 years ago by ben hockey

just to clarify how this happened in case you see more of it... this is due to r25490. even though dojo/_base/lang pulls in kernel, it doesn't return what's defined by kernel. before r25490 it used to. it was expected that we might find some cases like this after r25490.

comment:5 Changed 8 years ago by Adam Peller

thanks, I was going to ask about this... does that mean best practice is to treat _base modules like separate modules and not use the dojo.* global namespace? e.g. have two different function args for kernel and lang and use them separately in place of dojo.*

comment:6 Changed 8 years ago by ben hockey

there's a few ways to approach this.

  • use "dojo" as a dep and then you get all of base. this is the equivalent of previously including dojo.js
  • use "dojo/_base/kernel" as your handle to dojo.* and add other _base deps as needed but only ever use the return value from kernel as your handle to dojo.* - effectively, you're using the other _base deps to extend the kernel and ignoring their return values.
  • explicitly use the return value from each _base module as lang, declare, or whatever makes sense to you, as args in your factory function.

as i understand it, in the long term (ie for 2.0) the plan is to no longer have each of the base modules extend kernel. this would eliminate the 2nd option above. unless i'm just going to pull in all of base (the 1st option above) my personal preference is to do as you suggest (the 3rd option above) - have explicit args for each module and use them appropriately in place of dojo.* references.

Note: See TracTickets for help on using tickets.