How do you manage your DojoX code?

How do you control the use of DojoX code or widgets in a production application?

Dojo Toolkit consists of Core, Dijit and DojoX. As an incubator for new ideas to expand the DojoX toolkit, code and widgets function with varying degrees of instability.

DojoX code, such as QueryReadStore (for retrieving data packets from the server) or widgets such as Grid (for using the user interface grid component) are not included in Core or Dijit. But they are functional enough to be used in some cases, as the “developer fears” warning, because in future versions of the Toolkit API or the location of components in the source tree may change. Another problem is that you may need to configure the DojoX component, which you use to work correctly in your environment, as the code does not yet have a high degree of reliability.

So, how do you guarantee that as the DojoX components that you use are developing, your application stays on a smooth track?

+5
source share
2 answers

There are several ways to do this:

  • Stick to one version of Dojo and use it consistently.
  • Move the modified code to your own namespace and enable it.
    • Effectively branching an existing DojoX module. Responsibility for all code synchronization and reverse porting is your responsibility.
    • Pay attention to the rest of Dojo - if it changes so that it splits your forked version, be prepared to fix your module as well.
  • Copy the modified files somewhere and include / require them before the source file is needed.

, , , , dojox/charting/abc.js:

dojo.provide("dojox.charting.abc");
// the rest of the file
...

, , my/patched_abc.js, :

dojo.provide("my.patched_abc");
// now I include the rest of the file with my modifications

dojo.provide("dojox.charting.abc");
// the rest of the file
...

, dojox.charting, :

dojo.require("my.patched_abc");
// now I can include dojox.charting,
// which will use my patched dojox.charting.abc module

dojo.require("dojox.charting.Chart2D");
// the rest of the file
...

, "require".

backports . , .

+3

, ... : ! Dojo , JS-foo , . DojoX - , . , , , .

,

+4

All Articles