Tags:
- [New Feature]
- [Bug Fix]
- [Breaking Change]
- [Documentation]
- [Internal]
- [Polish]
- [Experimental]
Note: Gaps between patch versions are faulty/broken releases. Note: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.
- Polish
- Possibility to use flexible sorting, PR #422 (@yasaricli)
- Bug Fix
- remove deleted refs keys from childRefs registry (@gbiryukov)
- Internal
- replace string refs with callback refs (@gbiryukov)
- add React 16 to
peerDependencies
(@gcanti)
- Bug Fix
- Respect path changes in Component
shouldComponentUpdate
, fix #388 (@gbiryukov)
- Respect path changes in Component
- New Feature
- German translation (@jpJuni0r)
- New Feature
- French translation (@jebarjonet)
- Bug Fix
- make
numberTransformer
resistant to minification (UglifyJS withunsafe_comps
option) (@gbiryukov)
- make
- Bug Fix
- revert last commit
- New Feature
- Add item parameter to List.addItem function (@karlguillotte)
- Experimental
- optional
getTcombFormOptions
function on types
- optional
- Bug Fix
- struct's and list's validate() now set hasError to true when there are errors, fix #350 (@gcanti, thanks @volkanunsal)
- Bug Fix
- retain static functions when constructing concrete type from union (@minedeljkovic)
- Bug Fix
_nativeContainerInfo
no longer exists in React v15.2.0, use_hostContainerInfo
instead, fix #345 (thanks @kikoanis)transformer.parse
was not called for structs and lists (@gcanti)
- Experimental
- add support for interfaces (tcomb ^3.1.0), fix #341 (@gcanti)
- New Feature
- add support for union options (thanks @minedeljkovic)
- Bug Fix
- Broken with jspm, fix #331 (thanks @abhishiv)
- Bug Fix
- check for existing index in
List
'sgetValue
method, fix #322 (thanks @rajeshps)
- check for existing index in
- Bug Fix
- fix broken server side rendering with React v15.0.0, fix gcanti/tcomb-form-templates-bootstrap#7
- Optional or subtyped unions, fix #319
- Internal
- Move React to peerDependecies and devDependencies, fix #313 (thanks @maksis)
- Internal
- use empty string instead of null in textbox format, fix #308 (thanks @snadn). Reference https://facebook.github.io/react/blog/#new-deprecations-introduced-with-a-warning
- Bug Fix
- upgrade to
tcomb-form-templates-bootstrap
v0.2, ref gcanti/tcomb-json-schema#22
- upgrade to
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
- 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
- add dist configuration for unpkg
- 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 the uvdom
and uvdom-bootstrap
modules, this is not a breaking change for you.
I'm using the default bootstrap templates and the default language (english)
This is easy: nothing changed for you.
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!)
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;
- Bug Fix
- IE8 issue, 'this.refs.input' is null or not and object, fix #268
- Bug Fix
- use keys returned from getTypeProps as refs, #269
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 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
- Bug Fix
- de-optimise structs / lists onChange, fix #235
- Experimental
- add support for maybe structs and maybe lists, fix #236
- 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
- New Feature
- pass the component options to the error option function, fix #222
- Bug Fix
- Inconsistent error message creation process between
validate(val, type)
and form validation, fix #221 - Radio component does not have a transformer in IE10-, fix #226
- Inconsistent error message creation process between
- Internal
- upgrade to react v0.14
- New Feature
- add the type to template locals, fix #210
- Bug Fix
- Fields are wrapped in a form-group, fix #215
- Bug Fix
- Add className to locals of Struct and List (thanks @jsor)
- Internal
- upgrade to latest version of tcomb-validation (2.2.0)
- removed react-dom dependency
- removed debug dependency
- New Feature
- added argument
context
toerror
options that are functions (new signature:error(value, path, context)
) - added
error
option default if the type constructor owns agetValidationErrorMessage(value, path, context)
function - added
context
prop to all components (passed intoerror
ascontext
argument)
- added argument
- Breaking Change
- upgrade to react v0.14.0-rc1, fix #194
- New Feature
- added a
required
field to i18n, fix #181
- added a
- Bug Fix
help
option fort.Dat
gives bootstrap error #164
- Internal
- upgrade to latest version of tcomb-validation (2.0.0)
- Internal
- memoise
t.form.Component::getId()
- memoise
- Bug Fix
- Encountered two children with the same key fix #152
- Breaking Change
- upgrade to tcomb-validation v2.0.0-beta
- Internal
- Relax Bootstrap columns constraint #149
- Bug Fix
- Unable to disable t.Dat field #137
- New Feature
- t.Dat basic template (semantic skin)
- New Feature
- Add buttonBefore support (bootstrap skin) #126
- Bug Fix
- fix server-side rendering markup differences #124
- Internal
- tcomb-validation: upgrade to latest version
- New Feature
- Add buttonAfter support (bootstrap skin) #126
- Documentation
- Add
attrs
option - Add Date input
- Fix wrong imports in Customizations section
- Add
- Internal
- Optimise stuct and list re-rendering on value change
- fix server-side rendering markup differences #124
- Bug Fix
- Remove wrong label id attribute in date template (bootstrap skin)
- New Feature
- Add attributes and events (
attrs
option) #76, #91, #53, #67 - Add bootstrap static control, #92
- Set class on form-group div indicating its depth within form, #64
- Added
kind
param toonChange
handler
- Add attributes and events (
- Breaking Change
- Drop support for React v0.12.x
- Moved
placeholder
option withinattrs
option - Moved
id
option withinattrs
option
- Bug Fix
- Remove class "has-error" from empty optional numeric field #113
- Documentation
- Add GUIDE.md
- Internal
- Complete code refactoring
- New Feature
- Add experimental semantic ui skin
- Bug Fix
- Fix
nullOption
was incorrectly added to multiple selects
- Fix
- New Feature
- added
template
option to structs and lists - added
Component.extend
API - added
getComponent(path)
API - added basic date component
- added
- Internal
- complete code refactoring