All Versions
24
Latest Version
Avg Release Cycle
59 days
Latest Release
3331 days ago

Changelog History
Page 1

  • v0.13.2 Changes

    October 26, 2015

    ๐Ÿ’ฅ Breaking Changes

    • Now depends on React 0.14.

    ๐Ÿ”„ Changes

    • โš  Select and SelectMultiple no longer render selected attributes on their options, which was causing a warning message. React 0.14 now handles creating these in server-generated markup via parent context.
    • Documented that when using a custom rendering component with RenderForm, the Form instance is now available via a form context variable due to React 0.14 parent context.
  • v0.13.1

    October 26, 2015
  • v0.13.0

    October 23, 2015
  • v0.12.1 Changes

    March 12, 2015

    ๐Ÿ› Bug Fixes

    • ๐Ÿ”„ Changed method of detecting if we're running in the browser to avoid false positives when browserify/webpack insert process shims into browser bundles.

    A false positive can result in an Error being thrown when validating a client-side FormSet (#75)

  • v0.12.0 Changes

    March 11, 2015

    ๐Ÿš€ See the Upgrade Guide for instructions on upgrading to this release from the previous version.

    ๐Ÿ’ฅ Breaking Changes

    • Now depends on React 0.13.

    ๐Ÿ”„ Changes

    • ๐Ÿ‘ฏ RenderForm no longer depends on having React.addons.cloneWithProps()
      ๐Ÿ‘ฏ available for custom rendering, due to new React.cloneElement() top-level
      API.

    Removals

    • โœ‚ Removed deprecated formsetFactory().
  • v0.11.0 Changes

    March 11, 2015

    ๐Ÿš€ See the Upgrade Guide for instructions on upgrading to this release from the previous version.

    ๐Ÿ’ฅ Breaking Changes

    • ๐Ÿ“‡ Renamed BaseForm to Form, changing the top-level API - this has the same
      behaviour as the currently-exported forms.Form.
    • ๐Ÿ“‡ Renamed BaseFormSet to FormSet, changing the top-level API.
    • Replaced util.formData() with the
      ๐Ÿ“ฆ get-form-data module -
      formData() has been renamed to getFormData().
    • ๐Ÿ†• Newforms is now published to npm as flattened, top-level modules, so
      individual modules (such as Form, FormSet, fields, widgets, React
      components, ValidationError...) can be required with
      require('newforms/<modulename>') - this makes it possible to reduce the size
      ๐Ÿ’ป of your own browser bundles by requiring only what you use.

    ๐Ÿ†• New Features

    • โž• Added new core Field argument: field.widgetAttrs - this allows you to
      provide additional widget attributes without having to redefine the entire
      โœ… widget (docs) (#62)
    • โž• Added Form.prototype.prefixFormat ('{prefix}-{name}') and
      ๐Ÿ›  FormSet.prototype.prefixFormat ('{prefix}-{index}') to define how prefixes
      are generated. These can be overridden when extending these components to
      ๐Ÿ›  customise now field names are generated when prefixes are used
      โœ… (example) (#70)

    ๐Ÿ”„ Changes

    • โž• Added former formsetFactory() options to FormSet proper (API docs)
      • FormSet can now be constructed directly, setting all formset-specific options for the instance instead of having to extend it,
      • FormSet.extend() can now be used directly to preconfigure a FormSet
        constructor with the Form constructor to be used and any other formset
        options.
    • FormSet options can now be overridden when constructing a FormSet.
    • An error will now be thrown if a FormSet is constructed without a Form
      constructor.
    • ๐Ÿ’ป FileField cleaned data is now a native File object, when the browser
      ๐Ÿ‘Œ supports it (docs) (#61)
      • Added a multiple argument for FileField - cleaned data will be a list of
        File objects.
      • Filename length and empty file validation can now be performed on the client
        when a File object is available.
    • 0๏ธโƒฃ Widget attribute defaults are now always provided by numeric fields when not
      already set, regardless of the type of widget being used, to allow custom
      widgets which don't extend NumberInput to make use of them
      (#59)

    ๐Ÿ› Bug Fixes

    • DecimalField now handles all-zero inputs correctly - it was cleaning them
      to an empty string (#57)
    • โš  Select widgets no longer generate React dev-mode warnings about unique key
      props (#68)

    ๐Ÿ—„ Deprecations

    • ๐Ÿ—„ formsetFactory() is deprecated in favour of using FormSet.extend() to
      0๏ธโƒฃ create a FormSet with defaults for the same options and any custom methods
      required.

    Removals

    • โœ‚ Removed deprecated Form rendering methods (render(), asTable(), asDiv()
      and asUl()).
    • โœ‚ Removed deprecated FormSet rendering methods (render(), asTable() and
      asDiv()).
  • v0.10.1 Changes

    January 08, 2015
    • ๐Ÿ”– Version bump to fix tags -> keywords in package.json.
  • v0.10.0 Changes

    January 04, 2015

    0๏ธโƒฃ Major features in 0.10 are support for asynchronous validation and new React components for default rendering.

    ๐Ÿ“„ Asynchronous validation (docs)

    clean() and clean<FieldName>() methods can now use asynchronous validation - defining them with a single parameter will let newforms know they will be asynchronous: There is a bunch of new API on Forms, FormSets and BoundFields

    cleanUsername: function(cb) {// ...}
    

    form.validate() now takes an additional callback argument which is required if a Form or FormSet has async validation.

    0๏ธโƒฃ Default rendering now includes a <progress> element on fields, forms and formsets which have pending asynchronous validation.

    ๐Ÿ“„ React components (docs)

    ๐Ÿ†• Newforms now provides RenderForm and RenderFormSet React components for default Form and FormSet rendering:

    \<RenderForm form={MyForm} ref="myForm"/\>
    

    ๐Ÿš€ Default rendering methods on Forms and FormSets (.render(), .asTable(), .asDiv(), .asUl()) are now deprecated and will be removed in the next release.


    ๐Ÿ”„ CHANGES for 0.10.0

    ๐Ÿ’ฅ Breaking Changes

    • โœ‚ Removed formset.asUl() - it never appeared properly due to the management
      Form.
    • formset.cleanedData() to no longer includes cleanedData from incomplete
      extra forms.
    • You can no longer change cleanedData by returning a value from a Form's
      clean<Name>() or clean() method.

    ๐Ÿ†• New Features

    • โž• Added RenderForm, FormRow and RenderFormSet components for default
      rendering.
      • The browser build requires the react-with-addons build of React in order to
        ๐Ÿ‘‰ use RenderForm's custom rendering support.
    • Custom clean() and clean<Field>() validation methods can now be
      specified with the signature (callback) if they need to perform
      asynchronous validation.
      • The callback is an errback with the signature (err, validationError).
      • clean() will not be called until other fields - or just fields it
        ๐Ÿ”ง depends on, if configured - have been cleaned, synchronously or
        asynchronously.
    • form.validate() and formset.validate() now take a callback argument,
      which is required if the Form or Formset has custom async validation
      ๐Ÿ”ง configured - validate() can be used as normal for Form and Formsets
      without async validation.
      • The callback is an errback with the signature (err, isValid, cleanedData).
    • ๐Ÿ†• New API related to async validation:
      • form.isAsync() / formset.isAsync() - true if a form/formset has custom
        async validation.
      • form.isPending() / formset.isPending() - true if a form/formset has
        pending async validation.
      • form.nonFieldPending() / formset.nonFieldPending() - true if async
        validation of a form/formset's clean(cb) method is pending.
      • boundField.isPending() - true if a field has a pending async validation.
      • isFormAsync(Form) - true if a Form constructor's prototype has async
        validation methods.
    • 0๏ธโƒฃ <progress> indicators are now displayed by default rendering methods:
      • Beside fields with pending async validation.
      • At the end of the form when cross-field validation is pending.
    • โž• Added more conditional CSS classes which will be used if defined in a Form:
      • optionalCssClass - used for optional fields
      • pendingCssClass - used for fields with pending async validation
    • โž• Added boundField.helpTextTag() to expose the mechanism for rendering raw
      HTML.
    • โž• Added boundField.status() to get a field's status as a string
      0๏ธโƒฃ (pending/error/valid/default).
    • โž• Added fromJSON() factory functions to ErrorList and ErrorObject
      constructors and fromJSON() instance methods. These can be used to rehydrate
      an ErrorObject on the receiving end when form.errors() is transferred as
      JSON. This assumes the structure created by these objects' toJSON() methods.
    • โž• Added form.setErrors() to set an ErrorObject with errors from another
      source.
    • An ErrorObject can now be passed as an errors option when creating a form
      instance, to redisplay a form with errors from another source. This prevents
      the form's own validation from running if the form has input data and
      isValid() or errors() are called during rendering.

    ๐Ÿ—„ Deprecations

    • Form rendering methods (render(), asTable(), asDiv() and asUl()) are
      ๐Ÿ—„ deprecated in favour of using React components for rendering - RenderForm
      0๏ธโƒฃ now provides default rendering.
    • FormSet rendering methods (render(), asTable() and asDiv()) are
      ๐Ÿ—„ deprecated in favour of using React components for rendering - RenderFormSet
      0๏ธโƒฃ now provides default rendering.

    ๐Ÿ”„ Changes

    • ๐Ÿ”€ Reverted a change from 0.9. Synchronous calls to form/formset.validate()
      โšก๏ธ will trigger a re-render, as it looks like forceUpdate() just enqueues a
      future re-render.
    • form.isComplete() is now false if there is any pending async validation,
      even if all required fields currently have cleaned data.
    • ๐Ÿ”„ Changes to when event-based validation fires:
      • Validation now only fires if the field's data has changed since it was last
        0๏ธโƒฃ validated. For 'auto' validation, this prevents the default onBlur
        0๏ธโƒฃ event from re-running the same validation as the default onChange.
      • Special cases for onBlur:
      • Pending validation is triggered immediately.
      • Validation is always triggered if the field is required and empty.
    • ๐Ÿ”„ Changed form.addError() to no longer add duplicate error messages for the
      same field. This can happen if onChange validation which runs repeatedly
      โž• adds errors to a field other than that which triggered the validation, using
      addError().
    • 0๏ธโƒฃ The default rows attribute for a Textarea changed from 10 to 3.
    • Error messages now make use of a displayName property if a Form has one.

    Removals

    • ๐Ÿ—„ The deprecated onStateChange argument to Form and FormSet constructors has
      ๐Ÿšš been removed - use onChange instead.
  • v0.9.1 Changes

    November 25, 2014

    ๐Ÿ›  Fixed in this release:

    • The object given to Form.extend() is no longer mutated.
  • v0.9.0 Changes

    November 11, 2014

    ๐Ÿ‘€ (For an alternative view of new features/changes, see the Development Wiki)

    ๐Ÿš€ This release brings a bunch of sanity improvements (auto validation by default, better basic validation API) and improvements to FormSets which just about make them usable on the client (see Dinner Time! for an example).

    ๐Ÿ’ฅ Breaking Changes

    • Form mixins must now be specified as a __mixins__ property rather than
      __mixin__.
    • ๐Ÿ”„ Changed form.validate() to no longer call back to re-render -- this
      โšก๏ธ was convenient for single forms, but results in multiple updates when
      ๐Ÿ–จ processing multiple forms. Re-rendering must now be triggered manually if
      onSubmit validation fails.
    • formset.cleanedData() to no longer includes cleanedData from unmodified
      extra forms.

    ๐Ÿ†• New Features

    • Passing onChange to a Form or FormSet now implies validation: 'auto'.
    • โž• Added form.notEmpty() to determine when required fields in an extra
      FormSet form become truly required.
    • โž• Added formset.validate([form]) -- equivalent to the Form version, use to
      set a formset's data from a <form> or to force full validation of its
      current input data.
    • โž• Added formset.removeForm(index) to remove extra forms from a FormSet. It
      will also call back to trigger a re-render when possible.
    • โž• Added errorlist#first() for conveniently getting just the first validation
      error message.
    • โž• Added formset.addError() for adding non-form errors outside of clean().
    • ๐Ÿ”„ Changed form.validate([form]) so the argument is optional - it can now be
      ๐Ÿ‘‰ used to force full validation of a form with its current input data.
    • Form clean() functions can now specify which fields they make use of for
      cross-field validation: clean: ['field1', 'field2', function() {}]. When
      โšก๏ธ provided, clean() will only be called during partial form updates (e.g.
      onChange handling) if one of the specified fields is affected.

    ๐Ÿ—„ Deprecations

    • The onStateChange argument to Form and FormSet constructors -- use
      ๐Ÿšš onChange instead. onStateChange will be removed in the next version.

    ๐Ÿ”„ Changes

    • โšก๏ธ onChange handlers are now always attached to widgets to update input data,
      regardless of controlled/validation config.
    • formset.addAnother() will now call back to trigger a re-render if
      possible.
    • ๐Ÿ”„ Changed partial form validation to remove any validation errors if an extra
      FormSet form is unchanged from its initial values.