Aria Templates 1.5.1

This is a non-backward compatible release and changes are mainly about code cleaning and removing old features.

Removed features

The following deprecated features are now removed:

  • (deprecated in 1.4.10) 

sectionTabPanelTooltip and Dialog cannot be used as containers. $refresh signature change

section statement cannot be used as a container. Its macro configuration property is now mandatory.

filterSection and outputSection can no longer be used in the parameter passed to the $refresh method of the TemplateCtxt. They are replaced by the section property ({section : "sectionId"}). It is also advisable to stop specifying a macro as a second parameter, as each section now comes with a mandatory macro.

aria:Tooltip widget can no longer be used as a container. The macro property of its configuration is hence mandatory.

aria:TabPanel widget can no longer be used as a container. The macro property of its configuration is hence mandatory.

aria:Dialog widget can no longer be used as a container.

 

How does it work?

Escaping was already possible before, through the use of a specific modifier: escapeForHTML.

Now if the modifier doesn’t appear explicitly at the end of the list of modifiers, it will be automatically appended and configured to escape the string for all contexts (safest).

Note that this doesn’t prevent you from using the escaping modifier at any stage you want inside the modifiers chain, even multiple times.

Illustration

${input|capitalize}

// is equivalent to

${input|capitalize|escapeForHTML}

but this is left untouched:

        ${input|escapeForHTML|highlight:pattern|escapeForHTML:false}

How to disable or regain control over it?

If you want to disable this automatic final escaping, just explicitly use the modifier at the end of the list, passing the arguments you want (false if you actually want to disable it, but you can also refine its use by specifying a context for escaping – please refer to the documentation).

How to upgrade?

IMPORTANT: there was a previous existing modifier, called escape, which is not taken into account by this automatic processing. Thus, if you used it, this will result in some escaping being applied twice. Since the new modifier escapeForHTML is an enhanced one, you can replace the old escape with it. To be sure that this will work the same, configure it to escape only in the context of a HTML Node, like this:

${input|escape}
// becomes
${input|escapeForHTML:{text:true}}

Apart from the point above, the only case where your current code would break is if some expressions intend to output HTML. The HTML can be introduced by several means:

      • the initial input value you provide
      • the input values you would provide to the modifiers default or empty (or any other modifier which could inject user input values)
      • the modifiers themselves: for instance highlight

In this case, simply disable the automatic final escaping by adding the modifier set to false at the end. And don’t forget to escape before, by putting the modifier at the proper place!

Example:

        ${input|escapeForHTML|highlight:pattern|escapeForHTML:false}
  • _enableMethodEvents is now false in ModuleCtrl

The default value of this._enableMethodEvents became false in the ModuleCtrl class, which should bring some performance gains. The implications of this change are the new default behaviors when calling any module’s public method, as follows:

    • no interceptors are added, the methods are called directly
    • no events methodCallBeginmethodCallEndmethodCallback are raised
    • RefreshMgr is not automatically paused for the span of the call to the module controller’s method

In case the developer wants to continue having the old behaviors, he should set this._enableMethodEvents = true in the constructor of his module controller, **before** calling the parent constructor.

  • {bindRefreshTo} statement
{bindRefreshTo} statement has been removed. Please use bindRefreshTo property of a {section} statement instead. See the samples below:

Old (deprecated) syntax:

{macro someMacro()}
  {section "foo"}
     {bindRefreshTo data.value/}
     ... content ...
  {/section}
{/macro}

Replacement

    {macro someMacro()}
      {section {
         id : "foo",
         macro : "mySectionMacro",
         bindRefreshTo : [{inside : data, to : "value"}]
      } /}
    {/macro}

    {macro mySectionMacro()}
      ... content ...
    {/macro}

 

  • contentMacro in @aria:Dialog.
    To improve the consistency with the other widgets, contentMacro has been renamed to macro in Dialog configuration.
  • Removing deprecated property sprType
    This commit aims to remove the deprecated property sprType inside the definition of a skin. Basically what you need to do is to substitute every sprType property with an object like this: frame : {frameType : "type of frame you want to use"}.

    Every sprType, that is actually a number, corresponds to a frameType, that is a string. To convert your sprType value into a frameType value please follow this guideline:

      • sprType : 3 —> frameType : “Table”
      • sprType : 4 —> frameType : “FixedHeight”
      • sprType : 5 —> frameType : “SimpleHTML”
      • sprType : 6 —> frameType : “Simple”
  • History API cross-browser implementation enhancement

Singleton class aria.utils.History provides a cross-browser implementation of HTML5 native history API. A new version was introduced in AT 1.4-2. With respect to the previous one, this one is more compliant with the standard behaviour:

    • the onpopstate class event is not raised after a pushState or replaceState.
    • the state property is available on the singleton and it corresponds to window.history.state.

Page reload and external navigation are supported also in browsers for which hash-based navigation fallback occurs (with the exception of IE7, for which the previous history is not kept after reloading, but only the current state is available). Backward compatibility with the previous version has been removed.

  • TemplateCtxt.getDomId() method has been removed
    The TemplateCtxt.getDomId() method became private. In an unlikely case you were using it, you should probably use $getId() instead.
  •  Removing deprecated resources
    This commit removes the deprecated resources: cn_CN, ko_KO, sp_AR, tw_TW, from Calendar, Date and MultiSelect.
  • bindValue property in @touch:Slider configuration has been removed
    Please use bind.value instead. The property was deprecated in version 1.4-11.
  • Removing touch:Dialog in favor of touch:Popup
    Removing the deprecated widget touch:Dialog in favor of touch:Popup.
  •  Removal of aria.widgets.IconLib
    The class has been removed, please remove references to it from your code.

Deprecated features

The following features are now deprecated but still supported.

  • request.postData to set POST request payload in IOAsyncRequestCfg has been deprecated since 1.2.6
Use request.data instead.
  • useXHRHeader and defaultXHRHeader in aria.core.IO
Use aria.core.IO.headers and aria.core.IO.postHeaders instead.
  • postHeader and related options
The following config options are deprecated:
    • postHeadercontentTypeHeader in aria.core.CfgBeans:IOAsyncRequestCfg (use headers)
    • postHeader in aria.modules.RequestBeans:RequestObject (use headers)
    • defaultPostHeader, useDefaultPostHeader, defaultContentTypeHeader, useDefaultContentTypeHeader in aria.core.IO (use aria.core.IO.headers and aria.core.IO.postHeaders)

Migration to noder-js

Aria Templates will use noder-js as its loader as part of the next non-backward compatible release (1.6.1). While most of this migration will not require any code change in applications, the following non-backward compatible changes are planned:
    • aria.core.ClassMgr will no longer be used for class loading. Its classComplete event will no longer be raised. Its methods will no longer work, except getBaseLogicalPath and unloadClass.
    • aria.core.ClassLoaderaria.core.CmlClassLoaderaria.core.CSSClassLoaderaria.core.JSClassLoaderaria.core.ResClassLoaderaria.core.TmlClassLoader and aria.core.TxtClassLoader will no longer be usable.
    • It will no longer be possible to create an instance of aria.core.TplClassLoader. Its static methods will still work, though (they will still be used internally by the framework).
    • aria.core.Cache.content.classes will no longer exist.
    • In case of errors in the class definition, Aria.classDefinition will raise exceptions instead of only logging errors.
    • Aria.eval will no longer return the last evaluated expression. The evaluated code will be wrapped in a function such that it will be possible to call return with the desired return value. For example:

var one = Aria.eval("1")

will have to be replaced, in Aria Templates 1.6.1, by:

var one = Aria.eval("return 1").

    • The build process of applications which create a custom packaging of the Aria Templates framework will have to be updated to support version 1.6.1 of Aria Templates (those changes will be detailed later).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>