Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4045

support a dev mode configuration

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Later Later
    • None
    • 8.5.2
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.6.0 S1

      There are several debug/development related properties:

      • debug-js true
      • org.zkoss.zk.ZUML.cache false
      • org.zkoss.zk.WPD.cache false
      • org.zkoss.zk.WCS.cache false
      • org.zkoss.web.classWebResource.cache false
      • org.zkoss.zk.ui.versionInfo.enabled true
      • <disable-zscript>false</disable-zscript>

      Developers might apply these properties when developing a zk app, we can provide a master property <dev-mode>true</dev-mode> that enables them all at once.

      Functional Spec.

      1. when enabling the dev mode, zk should print info messages to list above properties it applies when a server starts up like:

        Enable ZK dev mode with the following settings:
        debug-js : true
        org.zkoss.zk.ZUML.cache : false
        ...

        This can remind developers that such dev mode is enabled.

      2. when enabling the dev mode, zk should override existing property values and enforce dev mode setting values. That means ZK should ignore those property values specified by developers in zk.xml
        for example:
        <dev-mode>true</dev-mode>
        <!-- ZK ignores the property below for <dev-mode> -->
        <library-property>
            <name>org.zkoss.web.classWebResource.cache</name>
            <value>true</value>
        </library-property>
        
      3. This overriding way can allow developers keep their production zk.xml unchanged.
        For example, a zk.xml
        <dev-mode>true</dev-mode>
        production settings... 
        

        Then just remove <dev-mode>true</dev-mode>, the zk.xml is a production-ready zk.xml. No need to search and remove each debug related property.

      benefits

      • simplify debug/dev settings, developers don't need to enable them one by one
      • developers can know all debug/dev related properties at once. They can either enable dev mode or configure some of them by themselves.
      • although we can write a doc to list all these properties, a running feature is still much easier to use than reading a doc. Like IDE content assist is always much helpful than static javadoc.

      Notice

      • org.zkoss.bind.DebuggerFactory.enable is also debug-related. But it prints too much information when enabling it which might

            hawk hawk
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: