All Versions
48
Latest Version
Avg Release Cycle
63 days
Latest Release
2058 days ago

Changelog History
Page 3

  • v0.9.1 Changes

  • v0.9.0 Changes

    โš  Warning. If you don't rely in your codebase on the property maybe(MyType)(undefined) === null this is not a breaking change for you.

    • ๐Ÿ’ฅ Breaking Change
      • upgrade to tcomb-validation v3.0.0
    • ๐Ÿ’… Polish
      • remove evt.preventDefault() calls
  • v0.8.2 Changes

    • ๐Ÿ†• New Feature
      • now options can also be a function (value: any) -> object
      • support for unions, fix #297
      • add new isPristine field to components state
    • ๐Ÿ“š Documentation
      • add issue template (new GitHub feature)
  • v0.8.1 Changes

    • ๐Ÿ†• New Feature
      • add dist configuration for unpkg
  • v0.8.0 Changes

    Migration guide

    tcomb-form follows semver and technically this is a breaking change (hence the minor version bump). However, if you are using the default bootstrap templates, the default language (english) and you are not relying on the uvdom and uvdom-bootstrap modules, this is not a breaking change for you.

    How to

    0๏ธโƒฃ I'm using the default bootstrap templates and the default language (english)

    This is easy: nothing changed for you.

    0๏ธโƒฃ I'm using the default bootstrap templates but I override the language

    var t = require('tcomb-form/lib');
    -var templates = require('tcomb-form/lib/templates/bootstrap');
    +var templates = require('tcomb-form/node_modules/tcomb-form-templates-bootstrap');
    
    t.form.Form.templates = templates;
    t.form.Form.i18n = {
      ...
    };
    

    (contributions to src/i18n folder welcome!)

    0๏ธโƒฃ I'm using the default language (english) but I override the templates

    npm install tcomb-form-templates-semantic --save
    
    var t = require('tcomb-form/lib');
    var i18n = require('tcomb-form/lib/i18n/en');
    -var templates = require('tcomb-form/lib/templates/semantic');
    +var templates = require('tcomb-form-templates-semantic');
    
    t.form.Form.i18n = i18n;
    t.form.Form.templates = templates;
    
  • v0.7.10 Changes

    • ๐Ÿ› Bug Fix
      • IE8 issue, 'this.refs.input' is null or not and object, fix #268
  • v0.7.9 Changes

    • ๐Ÿ› Bug Fix
      • use keys returned from getTypeProps as refs, #269
  • v0.7.8 Changes

    โš  Warning. uvdom dependency is deprecated and will be removed in the next releases. If you are using custom templates based on uvdom, please add a static function toReactElement before upgrading to v0.8:

    const Type = t.struct({
      name: t.String
    })
    
    import { compile } from 'uvdom/react'
    
    function myTemplate(locals) {
      return {tag: 'input', attrs: { value: locals.value }}
    }
    
    myTemplate.toReactElement = compile // <= here
    
    const options = {
      fields: {
        name: {
          template: myTemplate
        }
      }
    }
    
    • ๐Ÿ†• New Feature

      • complete refactoring of bootstrap templates, fix #254

        • add a type property to button locals
        • one file for each template
        • every template own a series of render* function that can be overridden

        Example

        const Type = t.struct({
          name: t.String
        })
        
        const myTemplate = t.form.Form.templates.textbox.clone({
          // override default implementation
          renderInput: (locals) => {
            return <input value={locals.value} />
          }
        })
        
        const options = {
          fields: {
            name: {
              template: myTemplate
            }
          }
        }
        
        • more style classes for styling purposes, fix #171

        Example

        const Type = t.struct({
          name: t.String,
          rememberMe: t.Boolean
        })
        

        outputs

        <!-- fieldset fieldset-depth-<path depth> -->
        <fieldset class="fieldset fieldset-depth-0" data-reactid=".0.0">
          <!-- form-group form-group-depth-<path depth> form-group-<field name> -->
          <div class="form-group form-group-depth-1 form-group-name" data-reactid=".0.0.$name">
            ...
          </div>
          <div class="form-group form-group-depth-1 form-group-rememberMe" data-reactid=".0.0.$rememberMe">
            ...
          </div>
        </fieldset>
        
      • complete refactoring of semantic templates

        • add a type property to button locals
        • one file for each template
        • every template own a series of render* function that can be overridden
        • more style classes for styling purposes, fix #171
      • add context prop to template locals

    • ๐Ÿ› Bug Fix

      • Incosistent calling of tcomb-validation validate function in getTypeInfo and components for struct and list types, fix #253
      • avoid useless re-renderings of Datetime when the value is undefined
    • Experimental

      • if a type owns a getTcombFormFactory(options) static function, it will be used to retrieve the suitable factory

      Example

      // instead of
      const Country = t.enums.of(['IT', 'US'], 'Country');
      
      const Type = t.struct({
        country: Country
      });
      
      const options = {
        fields: {
          country: {
            factory: t.form.Radio
          }
        }
      };
      
      // you can write
      const Country = t.enums.of(['IT', 'US'], 'Country');
      
      Country.getTcombFormFactory = function (/*options*/) {
        return t.form.Radio;
      };
      
      const Type = t.struct({
        country: Country
      });
      
      const options = {};
      
    • Internal

      • remove raw param in getValue API (use validate() API instead)
      • remove deprecated types short alias from tests
      • factor out UIDGenerator from Form render method
      • optimize getError() return an error message only if hasError === true
  • v0.7.6 Changes

    • ๐Ÿ› Bug Fix
      • de-optimise structs / lists onChange, fix #235
    • Experimental
      • add support for maybe structs and maybe lists, fix #236
  • v0.7.5 Changes

    • ๐Ÿ› Bug Fix
      • optional refinement with custom error message not passing locals.error, fix #230
      • Kind is undefined in onChange for nested List, fix #231
    • Internal
      • custom error function now takes a parsed value