Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

TNT.js v0.1.0 Release

Pre-release
Pre-release
Compare
Choose a tag to compare
@samzhangjy samzhangjy released this 10 Jul 12:22
· 26 commits to main since this release

Welcome to TNT.js v0.1.0 Alpha release.

This release introduces numbers of breaking changes.

Breaking changes

  • <v> tags now has the ability of evaluating statements. For example:

    <v data="`Link to ${links[0].text}`"></v>

    Is now fully usable.

  • Initializing variables can now be using TNTApp.data().

    In the previous versions of TNT.js, variables can only be created using SymbolTable. Although this brings more space for customization, it made developing TNT.js applications way more complicated.

    So today, we're introducing a wrapper to the TNT core: TNTApp . TNTApp encapsulates the core TNT runtime, SymbolTable and plugins. A basic example of TNTApp is as follows:

    const app = new TNTApp(
      document.getElementById("root"),  // root element for TNT rendering
      () => { console.log(app.variables.x); }  // onload event callback
    );
    app.data({ x: 233 });  // variable initialization
  • Tag attribute data renderers

    • tnt-td renderer brings a new feature that allows users to use TNT variables inside tags.
    • tnt-sd renderer allows users to use TNT variables inside inline stylesheet.

    More on those in the documentation.

  • For loops template
    <t-for> element is a booming feature introduced in this release. It allows users to loop through and render data defined in arrays. E.g.:

    <t-for data="item in links">
      <li><v data="item">Link loading...</v></li>
    </t-for>

    Please refer to the demos for further information.

Minor changes

  • Refactored code to ES6 syntax
  • Usage with ES Modules
  • Removed TNTScript plugin since it's not quite complete
  • Relocation of source code files

Please note that this release is under alpha state, meaning more breaking changes may come in the future and not recommended to use in production.

Thank you for checking out Bugduck TNT.js v0.1.0 Alpha release. If you have any questions or feature requests, feel free to open up a new issue and we'll be happy to check it out!