Skip to content

Releases: refractproject/minim

0.20.7

31 Aug 11:56
a4638b7
Compare
Choose a tag to compare

Bug Fixes

  • Fixes a regression from 0.20.6 where metadata became an ObjectElement
    instead of ArrayElement as it was in the past.

0.20.5

21 May 17:49
0fcab76
Compare
Choose a tag to compare

Bug Fixes

  • JSON 0.6 enum serialisation will now remove fixed typeAttributes which are now present in API Elements 1.0 enumerations. These are removed for consistent serialisation of the 0.6 serialiser.

0.20.4

15 Feb 21:28
10ca355
Compare
Choose a tag to compare
  • Further performance improvements have been made to JSON Serialisation. The serialiser can now deserialise deep structures substantially faster.

0.20.2

08 Jan 17:33
adae793
Compare
Choose a tag to compare

Enhancements

  • Minim NPM package now contains a browser distribution in dist/minim.js.
  • Performance improvements have been made to JSON Serialisation. The serialiser can now serialise deep structures a little faster.

0.19.1

23 Aug 15:03
Compare
Choose a tag to compare

Enhancements

  • Serialisers will now throw TypeError with straight forward messages when you
    try to serialise a non-element type.

Bug Fixes

  • While accessing meta or attributes of a frozen element that does not contain
    meta or attributes, an exception was raised because these accessors would
    lazy load and attempt to mutate the element.

    These accessors will now return an empty frozen ObjectElement in these
    cases now to prevent mutation.

  • Fixes JSON 0.6 Deserialiser to correct deserialise enum elements.

    • When multiple sample values were present additional values were being discarded.
    • Deserialised enum content contained duplicate enumeration values.

0.19.0

04 Aug 13:27
Compare
Choose a tag to compare

Breaking

  • Updated enum serialization/deserialization in the JSON 0.6 serializer to match
    apiaryio/api-elements#28
  • Element.children and Element.recursiveChildren now return ArraySlice
    instead of an ArrayElement.
  • ArrayElement.filter and ArrayElement.find* now return ArraySlice
    instead of an ArrayElement.
  • The first, second and last methods on ArrayElement are now properties
    instead of methods.
  • ObjectElement.filter now returns an ObjectSlice instead of an
    ObjectElement.
  • When providing multiple element names to Element.findRecursive you must
    call freeze on the element beforehand so that the element has access to the
    parent of the element.

Enhancements

  • Introduced JSDoc documentation to public interfaces
  • Element now contains a freeze method to freeze and prevent an element
    from being mutated, this also adds a parent property on all child elements.

Bug Fixes

  • Handle serializing key-value pair without value
  • Deserialize dataStructure containing an array correctly

0.18.1

18 Jul 11:26
Compare
Choose a tag to compare

Bug Fixes

  • Prevent JSON Serialisers from throwing exception when serialising a key value
    pair without any value.

0.18.0

18 Jul 11:29
Compare
Choose a tag to compare

Breaking

  • JSON Serialisation now follows the JSON Refract serialisation rules defined at
    https://github.com/refractproject/refract-spec/blob/master/formats/json-refract.md.

    Existing serialiser is available during a transition period to aid migration
    to the new format.

    const JSONSerialiser = require('minim/serialisers/json-0.6');
    const serialiser = new JSONSerialiser();
    const element = serialiser.deserialise('Hello');
    serialiser.serialise(element);

Enhancements

  • ArrayElement high-order functions, map, filter and forEach now accept
    thisArg like the equivalent functionality in Array.

0.17.1

18 Jul 11:29
Compare
Choose a tag to compare

Bug Fixes

  • Initialising an Element with given meta or attributes as ObjectElement is now
    supported.
  • When converting JavaScript values to Refract, objects are now supported.
  • Adds a special case to serialise sourceMap elements as values.

0.17.0

18 Jul 11:29
Compare
Choose a tag to compare

Breaking

  • Element.toRefract() and Element.fromRefract() have been removed. JSON
    Serialisation is now decoupled from the Element model. A minim namespace
    provides a convenience toRefract(element) and fromRefract(object)
    methods.

  • ArrayElement children method has been replaced by a children property
    on all elements. You may now chain children in conjunction with filter to
    get the existing behaviour.

    Before:

    const numbers = doc.children((element) => element.element == 'number');

    After:

    const numbers = doc.children.filter((element) => element.element == 'number');

    OR

    const numbers = doc.children.findByElement('number');
  • BaseElement has been renamed to Element.

  • Embedded Refract support has been removed.

Enhancements

  • All elements now contain a children and recursiveChildren properties that
    return an ArrayElement of the respective children elements.
  • JSON Serialiser will no longer serialise empty meta and attributes into
    JSON objects.
  • Minim now contains a RefElement.
  • Element now contains a toRef() function to create a ref element referencing
    the element.