zpt
Version:
Zenon Page Templates - JS (ZPT-JS)
314 lines (242 loc) • 13.2 kB
Plain Text
New in future versions
- Avoid flashing?
- Replace callback functions by promises?
- Move configurations from context to configuration object?
- Add if: expression (example-> if: isImportant 'important' is equals to cond: isImportant 'important' '')?
- Add data-else and data-else-condition tags?
- Add data-switch expression and data-tcase expression?
- Implement adquisition?
- Add options.macro (string) to set the name of the macro to invoke in a full render command?
- Update command improved: support of method invocation and ranges?
- Full reactive support: support of nested object?
- Add support of chaining to dictionary actions (like the DeleteArray)?
- Implement VariableUpdate as a new dictionary action?
- Add effects support to dictionaryChanges?
- Don't throw any exception when an indexed node is not found?
- Replace string keys in AttributeIndex by objects?
New in 0.40.10
- Project migrated to ES modules: must work as well as CommonJS module.
- Esbuild used to bundle production versions.
New in 0.40.9
- Bug fixed: exception thrown when no i18n resource was found in i18nHelper.
New in 0.40.8
- Bug fixed: problem with npm solved.
New in 0.40.7
- Bug fixed: talOmitTag wasn't adding new nodes in the right position.
New in 0.40.6
- Bug fixed: talCondition did not update properly.
New in 0.40.5
- Bug fixed: attributeIndex class did not treat properly removing nodes outside ZPT; now it does not remove nodes explicitily, removes them if they are not found in DOM.
New in 0.40.4
- Bug fixed: jsdom dependency moved from dependencies to devDependencies in package.json file.
- Jquery dependency in devDependencies replaced by zzDOM.
New in 0.40.3
- Bug fixed: problem with log4javascript fixed.
New in 0.40.2
- Bugs fixed: some errors about updating and effects fixed.
New in 0.40.1
- Bug fixed: update errors using tables fixed.
New in 0.40.0
- Update effects initial support.
New in 0.39.0
- Update command improved: support of array and object operations added using a new configuration option (dictionaryActions).
- Partial reactive support added: only supports change of properties directly in dictionary (not includes nested objects).
New in 0.38.2
- Some errors about non declared variables fixed.
New in 0.38.1
- Bug fixed: problem with npm solved.
New in 0.38.0
- New configuration option added: goToURLHash. It is a boolean value (default to true the first execution of ZPT, the rest executions are default to false). If it is true ZPT-JS updates the location.href to the current URL hash. This is needed because normal behaviour does not work, ids generated by ZPT-JS are not available when the browser try to use the URL hash.
New in 0.37.1
- Bug fixed: an error occurs when strict mode is set to true and a var is defined using tal:define.
New in 0.37.0
- Removed jquery dependency in non dev.
- Jquery expressions replaced by query expressions.
- Bug fixed: jsdom dependency added.
- Added support to run tests using the console:
- npm run testBrowser // Run the related to browser tests
- npm run testNode // Run the related to node.js tests
- npm run test // Run all tests
New in 0.36.1
- Dependencies updated.
- Replaced node-jsdom dependency by jsdom due it is no longer maintained (install of ZPT-JS failed using some recent versions of node).
New in 0.36.0
- Added new command: update.
- Added options.updatedDictionary (object) to set the list of properties to bind.
New in 0.35.0
- 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"
New in 0.34.0
- 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"
New in 0.33.0
- Added support of folder dictionaries.
- Added nothing and default variables to all scopes. Added support of them to data-tcontent, data-treplace and data-trepeat. Added support of nothing to data-ton-error.
- Added support of structure to data-tcontent, data-ton-error and data-treplace.
New in 0.32.1
- Bug fixed: contents of metalFillSlot must not be evaluated.
New in 0.32.0
- New configuration option added: dictionaryExtension.
New in 0.31.1
- Bug fixed: malformed auto define tag in autoDefineHelper in some cases.
New in 0.31.0
- 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.
New in 0.30.0
- 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.
New in 0.29.0
- 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.
New in 0.28.0
- 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.
New in 0.27.0
- Add to dictionary context object.
- Name of window and context vars in dictionary can be configured in context.
New in 0.26.0
- setExternalMacroPrefixURL method in context replaced by externalMacroPrefixURL conf property.
New in 0.25.0
- Auto load of i18n files at init.
- Bug fixed: undefined attributtes crashed.
- Bug fixed: render elements generated outside the container (macros and loops).
New in 0.24.0
- Added setExternalMacroPrefixURL method to context.
New in 0.23.0
- Add to dictionary window object.
New in 0.22.5
- Bug fixed: jquery plugin was not working using standalone version.
- Uglify and jshint tasks added to gruntfile. All files lint free.
New in 0.22.4
- Bug fixed: all toString methods fixed (improved error messages).
New in 0.22.3
- Bug fixed: macro calls overwrite define attributes of macro definitions.
New in 0.22.2
- Bug fixed: local macro calls not working properly when using them in remote macros.
New in 0.22.1
- Bug fixed: scope errors in loops fixed.
New in 0.22.0
- Version of Jquery updated to 3.0.0.
New in 0.21.1
- Bug fixed: don't render a attribute with an undefined value.
New in 0.21.0
- Full support of boolean attributes (checked, compact, declare, defer, disabled, ismap, multiple, nohref, noresize, noshade, nowrap, readonly and selected).
New in 0.20.5
- Problem with version number of npmjs.
New in 0.20.4
- Bug fixed: value of notRemoveGeneratedTags option was not updated when zpt was invoked several times.
New in 0.20.3
- Bug fixed: offset added to loops to prevent buggy index properties when using dynamic loops.
- Updated userguide about web server for testing purposes.
New in 0.20.2
- Bug fixed: callback executed in processAllRootElements method of Parser class.
New in 0.20.1
- Bug fixed: dictionary not updated when calling several times to run method in Parser class.
- Bug fixed: node test fixed.
New in 0.20.0
- 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.
New in 0.19.0
- 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.
New in 0.18.0
- 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.
New in 0.17.0
- 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.
New in 0.16.0
- 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.
New in 0.15.1
- Bug fixed: buildRemotePageUrlList could throw an exception trying to resolve an expression which can't be resolved before rendering the document.
New in 0.15.0
- 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.
New in 0.14.0
- Now data-idomain tags can be set to an array of I18n instances.
New in 0.13.2
- Bug fixed: generated tags not removed before loading remote pages.
New in 0.13.1
- Bug fixed: generated tags not removed when needed.
New in 0.13.0
- Added support of multiroot: root now can be a string or an array of them.
New in 0.12.0
- Added support of map attributtes.
New in 0.11.0
- Added support of expressions in use-macro.
- Default delemiter character in external macros updated from '/' to '@'.
New in 0.10.0
- Added in expressions.
New in 0.9.2
- Bug fixed: wrong order in tal:repeat.
New in 0.9.1
- Standalone version fixed. Using browserify-derequire.
New in 0.9.0
- Added support of object members (using array delimiters).
New in 0.8.0
- Added help to select the correct I18n instance. Add data-ilanguage tag.
New in 0.7.0
- 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.
New in 0.6.0
- Migrate to Browserify (CommonJS modules).
New in 0.5.0
- Use ZPT namespace.
- Change signature of ZPT.run to use options instead of several arguments.
New in 0.4.0
- 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.
New in 0.3.0
- 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.
New in 0.2.0
- Initial version. Initially a fork of Distal but finally nearly all code removed. Added some code from JPT (migrated from Java).