Changelog History
Page 3
-
v0.9.1 Changes
- ๐ Bug Fix
- upgrade to
tcomb-form-templates-bootstrap
v0.2, ref https://github.com/gcanti/tcomb-json-schema/issues/22
- upgrade to
- ๐ Bug Fix
-
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
- upgrade to
- ๐
Polish
- remove
evt.preventDefault()
calls
- remove
- ๐ฅ Breaking Change
-
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 componentsstate
- now
- ๐ Documentation
- add issue template (new GitHub feature)
- ๐ New Feature
-
v0.8.1 Changes
- ๐ New Feature
- add dist configuration for unpkg
- ๐ New Feature
-
v0.8.0 Changes
- ๐ฅ Breaking Change
- drop
uvdom
,uvdom-bootstrap
dependencies - bootstrap templates in its own repo tcomb-form-templates-bootstrap
- semantic templates in its own repo tcomb-form-templates-semantic
- drop
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 theuvdom
anduvdom-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;
- ๐ฅ Breaking Change
-
v0.7.10 Changes
- ๐ Bug Fix
- IE8 issue, 'this.refs.input' is null or not and object, fix #268
- ๐ Bug Fix
-
v0.7.9 Changes
- ๐ Bug Fix
- use keys returned from getTypeProps as refs, #269
- ๐ Bug Fix
-
v0.7.8 Changes
โ Warning.
uvdom
dependency is deprecated and will be removed in the next releases. If you are using custom templates based onuvdom
, please add a static functiontoReactElement
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 templatelocals
๐ Bug Fix
- Incosistent calling of tcomb-validation
validate
function ingetTypeInfo
and components for struct and list types, fix #253 - avoid useless re-renderings of Datetime when the value is undefined
- Incosistent calling of tcomb-validation
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 = {};
- if a type owns a
Internal
- remove
raw
param ingetValue
API (usevalidate()
API instead) - remove deprecated types short alias from tests
- factor out UIDGenerator from
Form
render method - optimize
getError()
return an error message only ifhasError === true
- remove
-
v0.7.6 Changes
- ๐ Bug Fix
- de-optimise structs / lists onChange, fix #235
- Experimental
- add support for maybe structs and maybe lists, fix #236
- ๐ Bug Fix
-
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
- ๐ Bug Fix