ZPT-JS change log
0.35.0 4 Jun 2019
- Added new tag: data-declare. It declares a list of items, each item is a variable name, a variable type (optional) and a default value expression (optional too). Optionally a 'required' suffix can be added. A strict mode is set to true inside the node with this attribute.
-
Added some methods to context:
- setStrictMode( strictMode ). Set the value of strictMode (default value is false). If it is set to true all variables must be declared; if ZPT-JS finds a non declared variable in an expression an error occurs.
- isStrictMode(). Get the value of strictMode.
- Variable expression must match a regular expression. It is defined by zpt.context.getConf().variableNameRE and it is /^[A-Za-z0-9_/-]+$/ by default.
- errorFunction method of Context now is invoked when any error occurs except if the error is related to async preloading (in this case the asyncError method is invoked).
-
Added a prefix to private vars to avoid name collision: '_'. The renamed vars are:
- onErrorVarName: _on-error
- onErrorStructureVarName: _on-error-structure
- i18nDomainVarName: _i18nDomain
- i18nLanguageVarName: _i18nLanguage
- externalMacroUrlVarName: _externalMacroUrl
- strictModeVarName: _strictMode
- declaredVarsVarName: _declaredVars
- repeatVarName: _repeat
0.34.0 23 May 2019
- Now exists expression returns true when the path expressions following its expression returns a value and it is not undefined. It is false when the path expression cannot locate an object or if it evaluates to undefined.
-
Some exports added:
- exports.I18nBundle
- exports.expressionBuilder
- exports.evaluateHelper
- exports.ExpressionTokenizer
-
Name of tags simplified. The new name of attributes are:
- talCondition: data-condition
- talRepeat: data-repeat
- talAttributes: data-attributes
- talContent: data-content
- talDefine: data-define
- talOmitTag: data-omit-tag
- talReplace: data-replace
- talOnError: data-on-error
- metalDefineMacro: data-define-macro
- metalUseMacro: data-use-macro
- metalDefineSlot: data-define-slot
- metalFillSlot: data-fill-slot
- i18nDomain: data-domain
- i18nLanguage: data-language
0.33.0 8 May 2019
- Added support of folder dictionaries.
0.32.1 3 May 2019
- Bug fixed: contents of metalFillSlot must not be evaluated.
0.32.0 25 Apr 2019
- New configuration option added: dictionaryExtension.
0.31.1 24 Apr 2019
- Bug fixed: malformed auto define tag in autoDefineHelper in some cases.
0.31.0 23 Apr 2019
- Nocall expression replaced by suffix in data-tdefine.
- Rerun bugs fixed using data-idomain, data-ilanguage, data-ton-error, data-trepeat, internal and external macros.
0.30.0 21 Apr 2019
- scopeCache class removed, replaced by scopeBuilder: it traverses the DOM from a node to its parents to get all data-tdefine tags and execute them in reverse order.
- Added command configuration option. Valid values are preload, fullRender or partialRender.
0.29.0 21 Apr 2019
- Save every scope into a cache, set an id to it and put it in HTML using a data-tscope tag to make it easy to re-render.
- Exported method removed: buildParser. The only exported method is run. First invokation preloads external resources (i18n files and external macros files), the next ones parser the DOM.
0.28.0 20 Dec 2018
- Added setErrorFunction method to context. It manages initialization errors (trying to load external files like external template files or i18n files).
- Added errorCallback parameter to init method of Parser class. It also manages initialization errors. If an errorCallback is defined is used; otherwise errorFunction in context is used.
0.27.0 28 Nov 2018
- Add to dictionary context object.
- Name of window and context vars in dictionary can be configured in context.
0.26.0 27 Nov 2018
- setExternalMacroPrefixURL method in context replaced by externalMacroPrefixURL conf property.
0.25.0 23 Nov 2018
- Auto load of i18n files at init.
- Bug fixed: undefined attributtes crashed.
- Bug fixed: render elements generated outside the container (macros and loops).
0.24.0 19 Nov 2018
- Added setExternalMacroPrefixURL method to context.
0.23.0 16 Nov 2018
- Add to dictionary window object.
0.22.5 9 Oct 201
- Bug fixed: jquery plugin was not working using standalone version.
- Uglify and jshint tasks added to gruntfile. All files lint free.
0.22.4 23 Aug 2018
- Bug fixed: all toString methods fixed (improved error messages).
0.22.3 2 Jul 2018
- Bug fixed: macro calls overwrite define attributes of macro definitions.
0.22.2 12 Jun 2018
- Bug fixed: local macro calls not working properly when using them in remote macros.
0.22.1 10 May 2018
- Bug fixed: scope errors in loops fixed.
0.22.0 12 Mar 2018
- Version of Jquery updated to 3.0.0.
0.21.1
- Bug fixed: don't render a attribute with an undefined value.
0.21.0 31 Dec 2017
- Full support of boolean attributes (checked, compact, declare, defer, disabled, ismap, multiple, nohref, noresize, noshade, nowrap, readonly and selected).
0.20.5 15 Nov 2017
- Problem with version number of npmjs.
0.20.4 15 Nov 2017
- Bug fixed: value of notRemoveGeneratedTags option was not updated when zpt was invoked several times.
0.20.3 10 Nov 2017
- Bug fixed: offset added to loops to prevent buggy index properties when using dynamic loops.
- Updated userguide about web server for testing purposes.
0.20.2 13 Oct 2017
- Bug fixed: callback executed in processAllRootElements method of Parser class.
0.20.1 13 Oct 2017
- Bug fixed: dictionary not updated when calling several times to run method in Parser class.
- Bug fixed: node test fixed.
0.20.0 1 Oct 2017
- Some changes in Parser class: run method removed, runSync method renamed to run. This makes run method is always sync, so all code is in init method.
0.19.0 26 Sep 2017
- Makes it easy to separate async code (for loading external macros files) from sync code.
- Resolver class now is singleton.
- New exported method: buildParser.
- Added init and runSync methods to Parser class.
0.18.0 14 Sep 2017
- Added http-server dev dependency for testing purposes: now it is possible to run tests using the HTTP server in port 9000. Run 'npm run start' in your console and then open 'http://localhost:9000/test/' in your browser.
0.17.0 11 Sep 2017
- Make it easy to use ZPT's original attributes. Added useOriginalTags method to context.
- New exported method: logHelper.
- Some logs changed from info to debug.
- Added try-catch to run method in parser.
0.16.0 6 Sep 2017
- Bug fixed: local macros now work when defining one in an external file.
- Better error messages: error messages now show the source attribute or string expression.
0.15.1 31 Aug 2017
- Bug fixed: buildRemotePageUrlList could throw an exception trying to resolve an expression which can't be resolved before rendering the document.
0.15.0 31 Aug 2017
- New exported method: context.
-
Better logging support:
- It can be activated or deactivated setting context.getConf().loggingOn (default is off).
- The log level can be customized setting context.getConf().loggingLevel (default is ERROR).
- It can be fully customized using context.setLogger( log4javascriptInstance ). See http://log4javascript.org/ for details.
0.14.0 11 Aug 2017
- Now data-idomain tags can be set to an array of I18n instances.
0.13.2 9 Aug 2017
- Bug fixed: generated tags not removed before loading remote pages.
0.13.1 8 Aug 2017
- Bug fixed: generated tags not removed when needed.
0.13.0 8 Aug 2017
- Added support of multiroot: root now can be a string or an array of them.
0.12.0 27 Jul 2017
- Added support of map attributtes.
0.11.0 25 Jul 2017
- Added support of expressions in use-macro.
- Default delemiter character in external macros updated from '/' to '@'.
0.10.0 19 Jul 2017
0.9.2 3 Jul 2017
- Bug fixed: wrong order in tal:repeat.
0.9.1 1 Jun 2017
- Standalone version fixed. Using browserify-derequire.
0.9.0 30 May 2017
- Added support of object members (using array delimiters).
0.8.0 7 Apr 2017
- Added help to select the correct I18n instance. Add data-ilanguage tag.
0.7.0 1 Apr 2017
- Support of custom expressions. Refactoring of expressionEvaluator class.
- Cache of expressions and ZPT attributes.
- Some logging support.
- Support of Node.js. Sample and tests added.
0.6.0 16 Nov 2016
- Migrate to Browserify (CommonJS modules).
0.5.0 7 Nov 2016
- Use ZPT namespace.
- Change signature of ZPT.run to use options instead of several arguments.
0.4.0 3 Nov 2016
- Added number formatting L10n using Intl.
- Added currency formatting L10n using Intl (currency codes from ISO 4217).
- Added date/time formatting L10n using Intl.
- Added tr, trNumber, trCurrency and trDate expressions.
- Remove all i18n tags except data-idomain.
0.3.0 24 October 2016
- Added i18n capabilities (only for text) using messageformat.js.
-
Added i18n tags:
- data-idomain. Register a list of I18n instances to do i18n.
- data-idefine. Search the specified value into the available I18n instances and save the value to a variable.
- data-icontent. It works as data-tcontent, but searching the specified value into the availablbeefye I18n instances.
- data-ireplace. As data-treplace.
- data-iattributes. As data-tattributes.
- data-ion-error. As data-ton-error.
0.2.0 3 October 2016
- Initial version. Initially a fork of Distal but finally nearly all code removed. Added some code from JPT (migrated from Java).