[d24f17c] | 1 | # Minim Changelog
|
---|
| 2 |
|
---|
| 3 | ## 0.23.8 (2020-06-12)
|
---|
| 4 |
|
---|
| 5 | ### Enhancements
|
---|
| 6 |
|
---|
| 7 | - `ArrayElement`'s `contains` method has been renamed to `includes` to be
|
---|
| 8 | consistent with `Array.includes`. `ArrayElement.contains` has been
|
---|
| 9 | deprecated, and remains for compatibility.
|
---|
| 10 |
|
---|
| 11 | ### Bug Fixes
|
---|
| 12 |
|
---|
| 13 | - Prevent throwing an error when calling `toValue()` on an element with a key
|
---|
| 14 | value pair which does not have a value.
|
---|
| 15 |
|
---|
| 16 | ## 0.23.7 (2020-04-27)
|
---|
| 17 |
|
---|
| 18 | ### Bug Fixes
|
---|
| 19 |
|
---|
| 20 | - Prevents the JSON serializer from serializing an empty object (`{}`) under
|
---|
| 21 | meta and attributes under the case where none of the meta or attribute
|
---|
| 22 | member's have a value. This prevents `{}` from being present under meta or
|
---|
| 23 | attributes when setting a member with an undefined key.
|
---|
| 24 |
|
---|
| 25 | ## 0.23.6 (2019-09-10)
|
---|
| 26 |
|
---|
| 27 | ### Bug Fixes
|
---|
| 28 |
|
---|
| 29 | - Fixes a JSON 0.6 serialisation bug where httpRequest and similar array-based
|
---|
| 30 | elements with undefined content would be serialised with undefined content
|
---|
| 31 | instead of an empty array as content.
|
---|
| 32 |
|
---|
| 33 | ## 0.23.5 (2019-07-02)
|
---|
| 34 |
|
---|
| 35 | This release brings some performance improvements, namely to serialising with
|
---|
| 36 | the JSON serialisers.
|
---|
| 37 |
|
---|
| 38 | ## 0.23.4 (2019-06-11)
|
---|
| 39 |
|
---|
| 40 | ### Bug Fixes
|
---|
| 41 |
|
---|
| 42 | - Fixes serialisation of default values in enumerations in
|
---|
| 43 | Refract JSON 0.6 serialisation.
|
---|
| 44 |
|
---|
| 45 | ## 0.23.3 (2019-04-06)
|
---|
| 46 |
|
---|
| 47 | ### Enhancements
|
---|
| 48 |
|
---|
| 49 | - Added support for IE11 in the included web distribution of minim
|
---|
| 50 | (`dist/minim.js`).
|
---|
| 51 |
|
---|
| 52 | ## 0.23.2 (2019-03-15)
|
---|
| 53 |
|
---|
| 54 | ### Bug Fixes
|
---|
| 55 |
|
---|
| 56 | - Fixes serialisation of array and object sample values in enumerations in
|
---|
| 57 | Refract JSON 0.6 serialisation.
|
---|
| 58 |
|
---|
| 59 | ## 0.23.1 (2019-02-25)
|
---|
| 60 |
|
---|
| 61 | ### Bug Fixes
|
---|
| 62 |
|
---|
| 63 | - Restores documentation coverage for all elements, some was unintentionally
|
---|
| 64 | removed in 0.23.0.
|
---|
| 65 |
|
---|
| 66 | ## 0.23.0 (2019-02-22)
|
---|
| 67 |
|
---|
| 68 | ### Breaking
|
---|
| 69 |
|
---|
| 70 | - Support for Node 4 has been removed. Minim now supports Node >= 6.
|
---|
| 71 | - Minim no longer uses [uptown](http://github.com/smizell/uptown) and thus the
|
---|
| 72 | `extend` API has been removed.
|
---|
| 73 |
|
---|
| 74 | ### Enhancements
|
---|
| 75 |
|
---|
| 76 | - Calling `.freeze()` on a frozen element is now supported. Previously you may
|
---|
| 77 | see an error thrown while freeze was trying to attach parents to any child
|
---|
| 78 | elements.
|
---|
| 79 |
|
---|
| 80 | ## 0.22.1 (2018-12-10)
|
---|
| 81 |
|
---|
| 82 | ### Bug Fixes
|
---|
| 83 |
|
---|
| 84 | - Fixes serialising an element with an undefined meta or attributes value. For
|
---|
| 85 | example if a meta value (`id`) was set to `undefined`, then it should not be
|
---|
| 86 | serialised. Previously the serialiser would throw an exception that
|
---|
| 87 | undefined was not an element.
|
---|
| 88 |
|
---|
| 89 | ## 0.22.0
|
---|
| 90 |
|
---|
| 91 | ### Enhancements
|
---|
| 92 |
|
---|
| 93 | - `ArrayElement` now conforms to parts of the [Fantasy
|
---|
| 94 | Land](https://github.com/fantasyland/fantasy-land) 3.5 specification.
|
---|
| 95 | `Functor`, `Semigroup`, `Monoid`, `Filterable`, `Chain`, and `Foldable` are
|
---|
| 96 | now supported.
|
---|
| 97 |
|
---|
| 98 | ## 0.21.1
|
---|
| 99 |
|
---|
| 100 | ### Bug Fixes
|
---|
| 101 |
|
---|
| 102 | - Empty parseResult and link arrays are serialised in JSON 06 Serialiser, a
|
---|
| 103 | regression of 0.21.0 caused these to not be serialised.
|
---|
| 104 |
|
---|
| 105 | ## 0.21.0
|
---|
| 106 |
|
---|
| 107 | ### Breaking
|
---|
| 108 |
|
---|
| 109 | - Minim no longer supports importing files directly from the minim package.
|
---|
| 110 | Importing the JSON 0.6 serialiser via
|
---|
| 111 | `require('minim/lib/serialisers/json-0.6')` is not supported, it is now
|
---|
| 112 | recommended to import `JSON06Serialiser` and other APIs from minim directly.
|
---|
| 113 |
|
---|
| 114 | ```js
|
---|
| 115 | const { JSON06Serialiser } = require('minim');
|
---|
| 116 | ```
|
---|
| 117 |
|
---|
| 118 | - `flatMap` in `ArraySlice` no longer removes empty items. Instead `flatMap` is
|
---|
| 119 | aligned with
|
---|
| 120 | [`Array.flatMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap)
|
---|
| 121 | which first maps each element using a mapping function, then flattens the
|
---|
| 122 | result into a new array.
|
---|
| 123 |
|
---|
| 124 | Existing `flatMap` behaviour is now available under the method `compactMap`.
|
---|
| 125 |
|
---|
| 126 | ### Enhancements
|
---|
| 127 |
|
---|
| 128 | - Object Element can now be created with an array of member elements.
|
---|
| 129 |
|
---|
| 130 | - You can now create an element from an ArraySlice or ObjectSlice, for example,
|
---|
| 131 | passing the result of a `filter` operation into a new element.
|
---|
| 132 |
|
---|
| 133 | ```
|
---|
| 134 | const numbers = new ArrayElement([1, 2, 3, 4])
|
---|
| 135 | new ArrayElement(numbers.filter((e) => e.toValue() % 2))
|
---|
| 136 | ```
|
---|
| 137 |
|
---|
| 138 | - Adds `compactMap` functionality to Array and Object elements allowing you to
|
---|
| 139 | returns an array containing the truthy results of calling the given
|
---|
| 140 | transformation with each element of this sequence.
|
---|
| 141 |
|
---|
| 142 | - Added `flatMap` to `ArrayElement`.
|
---|
| 143 |
|
---|
| 144 | ### Bug Fixes
|
---|
| 145 |
|
---|
| 146 | - The default content value of an element is undefined. Whereas before the
|
---|
| 147 | default value was `null`.
|
---|
| 148 |
|
---|
| 149 | - Setting the `content` property on an Element now behaves the same as passing
|
---|
| 150 | content in to the constructor. For example, the following two elements are
|
---|
| 151 | identical:
|
---|
| 152 |
|
---|
| 153 | ```js
|
---|
| 154 | new ArrayElement([1])
|
---|
| 155 |
|
---|
| 156 | const element = new ArrayElement()
|
---|
| 157 | element.content = [1]
|
---|
| 158 | ```
|
---|
| 159 |
|
---|
| 160 | Passing `[1]` to an `ArrayElement` constructor would produce an array of
|
---|
| 161 | number elements, whereas setting the content to `[1]` resulted in setting the
|
---|
| 162 | content to be an array of non-elements which is invalid.
|
---|
| 163 |
|
---|
| 164 | - The serialisation of the `variable` attribute in the JSON 0.6 serialisation
|
---|
| 165 | is updated to reflect API Elements 1.0. The `variable` attribute is now
|
---|
| 166 | present on a member element instead of the key of a member element.
|
---|
| 167 |
|
---|
| 168 | - Empty arrays are no longer serialised in JSON 06 Serialiser.
|
---|
| 169 |
|
---|
| 170 | ## 0.20.7
|
---|
| 171 |
|
---|
| 172 | ### Bug Fixes
|
---|
| 173 |
|
---|
| 174 | - Fixes a regression from 0.20.6 where `metadata` became an `ObjectElement`
|
---|
| 175 | instead of `ArrayElement` as it was in the past.
|
---|
| 176 |
|
---|
| 177 | ## 0.20.6
|
---|
| 178 |
|
---|
| 179 | ### Bug Fixes
|
---|
| 180 |
|
---|
| 181 | - JSON 0.6 deserialiser will now correct deserialise an API Categories `meta`
|
---|
| 182 | attribute into `metadata`.
|
---|
| 183 |
|
---|
| 184 | - JSON Serialisers will now use elements from the given namespace during
|
---|
| 185 | serialisation checks and deserialisation.
|
---|
| 186 |
|
---|
| 187 | ## 0.20.5
|
---|
| 188 |
|
---|
| 189 | ### Bug Fixes
|
---|
| 190 |
|
---|
| 191 | - JSON 0.6 enum serialisation will now remove `fixed` typeAttributes which are
|
---|
| 192 | now present in API Elements 1.0 enumerations. These are removed for
|
---|
| 193 | consistent serialisation of the 0.6 serialiser.
|
---|
| 194 |
|
---|
| 195 | ## 0.20.4
|
---|
| 196 |
|
---|
| 197 | - Further performance improvements have been made to JSON Serialisation. The
|
---|
| 198 | serialiser can now deserialise deep structures substantially faster.
|
---|
| 199 |
|
---|
| 200 | ## 0.20.3
|
---|
| 201 |
|
---|
| 202 | ### Enhancements
|
---|
| 203 |
|
---|
| 204 | - Minim NPM package now contains a browser distribution in `dist/minim.js`.
|
---|
| 205 | - Performance improvements have been made to JSON Serialisation. The serialiser
|
---|
| 206 | can now serialise deep structures a little faster.
|
---|
| 207 |
|
---|
| 208 | ## 0.20.2
|
---|
| 209 |
|
---|
| 210 | ### Bug Fixes
|
---|
| 211 |
|
---|
| 212 | - The JSON 0.6 serialiser will now serialise empty content arrays. A regression
|
---|
| 213 | caused in 0.20.1 because of the logic was applied to both Refract JSON 1.0
|
---|
| 214 | and 0.6 serialisers.
|
---|
| 215 |
|
---|
| 216 | ## 0.20.1
|
---|
| 217 |
|
---|
| 218 | ### Bug Fixes
|
---|
| 219 |
|
---|
| 220 | - Prevent de-serialising `undefined` if the default element's content is not
|
---|
| 221 | null.
|
---|
| 222 | - No longer serialise an empty array in the JSON serialisers, instead the
|
---|
| 223 | content can be removed for consistency with other tools.
|
---|
| 224 |
|
---|
| 225 | ## 0.20.0
|
---|
| 226 |
|
---|
| 227 | ### Enhancements
|
---|
| 228 |
|
---|
| 229 | - Adds a `reject` method to `ArrayElement`, `ObjectElement`, `ArraySlice`,
|
---|
| 230 | and `ObjectSlice` which complements the `filter` method providing the ability
|
---|
| 231 | to exclude vs filter matched elements.
|
---|
| 232 |
|
---|
| 233 | ### Breaking
|
---|
| 234 |
|
---|
| 235 | - The Refract JSON 0.6 serialiser will de-serialise enum elements into the form
|
---|
| 236 | in the API Elements 1.0 specification. This is a breaking change on the
|
---|
| 237 | layout of the enum. Default and sample values will now be an `enum` element
|
---|
| 238 | themselves.
|
---|
| 239 |
|
---|
| 240 | ### Bug Fixes
|
---|
| 241 |
|
---|
| 242 | - JSON deserialisers will now prevent overriding default element content
|
---|
| 243 | values with undefined. This could cause problems where internal state of
|
---|
| 244 | array or object element would have undefined as content and thus cause other
|
---|
| 245 | Element methods to later fail such as `toValue` or `get`.
|
---|
| 246 |
|
---|
| 247 | ## 0.19.2
|
---|
| 248 |
|
---|
| 249 | ### Enhancements
|
---|
| 250 |
|
---|
| 251 | - ArraySlice now provides a `find` method allowing you to find the first
|
---|
| 252 | element satisfying the given value.
|
---|
| 253 | - ArraySlice.filter now accepts element names or element classes to filter.
|
---|
| 254 | - ArraySlice now provides `flatMap` allowing you to map and then flatten the
|
---|
| 255 | results.
|
---|
| 256 |
|
---|
| 257 | ### Bug Fixes
|
---|
| 258 |
|
---|
| 259 | - Accessing lazy meta accessors on frozen elements such as `title` will now
|
---|
| 260 | return a frozen default value. Previously this would raise an exception
|
---|
| 261 | trying to mutate the element.
|
---|
| 262 |
|
---|
| 263 | ## 0.19.1
|
---|
| 264 |
|
---|
| 265 | ### Enhancements
|
---|
| 266 |
|
---|
| 267 | - Serialisers will now throw TypeError with straight forward messages when you
|
---|
| 268 | try to serialise a non-element type.
|
---|
| 269 |
|
---|
| 270 | ### Bug Fixes
|
---|
| 271 |
|
---|
| 272 | - While accessing meta or attributes of a frozen element that does not contain
|
---|
| 273 | meta or attributes, an exception was raised because these accessors would
|
---|
| 274 | lazy load and attempt to mutate the element.
|
---|
| 275 |
|
---|
| 276 | These accessors will now return an empty frozen `ObjectElement` in these
|
---|
| 277 | cases now to prevent mutation.
|
---|
| 278 | - Fixes JSON 0.6 Deserialiser to correct deserialise enum elements.
|
---|
| 279 | - When multiple sample values were present additional values were being discarded.
|
---|
| 280 | - Deserialised enum content contained duplicate enumeration values.
|
---|
| 281 |
|
---|
| 282 | ## 0.19.0
|
---|
| 283 |
|
---|
| 284 | ### Breaking
|
---|
| 285 |
|
---|
| 286 | - Updated enum serialization/deserialization in the JSON 0.6 serializer to match
|
---|
| 287 | https://github.com/apiaryio/api-elements/pull/28
|
---|
| 288 | - `Element.children` and `Element.recursiveChildren` now return `ArraySlice`
|
---|
| 289 | instead of an `ArrayElement`.
|
---|
| 290 | - `ArrayElement.filter` and `ArrayElement.find*` now return `ArraySlice`
|
---|
| 291 | instead of an `ArrayElement`.
|
---|
| 292 | - The `first`, `second` and `last` methods on `ArrayElement` are now properties
|
---|
| 293 | instead of methods.
|
---|
| 294 | - `ObjectElement.filter` now returns an `ObjectSlice` instead of an
|
---|
| 295 | `ObjectElement`.
|
---|
| 296 | - When providing multiple element names to `Element.findRecursive` you must
|
---|
| 297 | call `freeze` on the element beforehand so that the element has access to the
|
---|
| 298 | parent of the element.
|
---|
| 299 |
|
---|
| 300 | ### Enhancements
|
---|
| 301 |
|
---|
| 302 | - Introduced JSDoc documentation to public interfaces
|
---|
| 303 | - `Element` now contains a `freeze` method to freeze and prevent an element
|
---|
| 304 | from being mutated, this also adds a parent property on all child elements.
|
---|
| 305 |
|
---|
| 306 | ### Bug Fixes
|
---|
| 307 |
|
---|
| 308 | - Handle serializing key-value pair without value
|
---|
| 309 | - Deserialize `dataStructure` containing an array correctly
|
---|
| 310 |
|
---|
| 311 | ## 0.18.1
|
---|
| 312 |
|
---|
| 313 | ### Bug Fixes
|
---|
| 314 |
|
---|
| 315 | - Prevent JSON Serialisers from throwing exception when serialising a key value
|
---|
| 316 | pair without any value.
|
---|
| 317 |
|
---|
| 318 | ## 0.18.0
|
---|
| 319 |
|
---|
| 320 | ### Breaking
|
---|
| 321 |
|
---|
| 322 | - JSON Serialisation now follows the JSON Refract serialisation rules defined at
|
---|
| 323 | https://github.com/refractproject/refract-spec/blob/master/formats/json-refract.md.
|
---|
| 324 |
|
---|
| 325 | Existing serialiser is available during a transition period to aid migration
|
---|
| 326 | to the new format.
|
---|
| 327 |
|
---|
| 328 | ```js
|
---|
| 329 | const JSONSerialiser = require('minim/serialisers/json-0.6');
|
---|
| 330 | const serialiser = new JSONSerialiser();
|
---|
| 331 | const element = serialiser.deserialise('Hello');
|
---|
| 332 | serialiser.serialise(element);
|
---|
| 333 | ```
|
---|
| 334 |
|
---|
| 335 | ### Enhancements
|
---|
| 336 |
|
---|
| 337 | - ArrayElement high-order functions, `map`, `filter` and `forEach` now accept
|
---|
| 338 | `thisArg` like the equivalent functionality in `Array`.
|
---|
| 339 |
|
---|
| 340 | ## 0.17.1 (2016-07-29)
|
---|
| 341 |
|
---|
| 342 | ### Bug Fixes
|
---|
| 343 |
|
---|
| 344 | - Initialising an Element with given meta or attributes as ObjectElement is now
|
---|
| 345 | supported.
|
---|
| 346 | - When converting JavaScript values to Refract, objects are now supported.
|
---|
| 347 | - Adds a special case to serialise sourceMap elements as values.
|
---|
| 348 |
|
---|
| 349 | ## 0.17.0 (2017-06-16)
|
---|
| 350 |
|
---|
| 351 | ### Breaking
|
---|
| 352 |
|
---|
| 353 | - `Element.toRefract()` and `Element.fromRefract()` have been removed. JSON
|
---|
| 354 | Serialisation is now decoupled from the Element model. A minim namespace
|
---|
| 355 | provides a convenience `toRefract(element)` and `fromRefract(object)`
|
---|
| 356 | methods.
|
---|
| 357 |
|
---|
| 358 | - `ArrayElement` `children` method has been replaced by a `children` property
|
---|
| 359 | on all elements. You may now chain children in conjunction with `filter` to
|
---|
| 360 | get the existing behaviour.
|
---|
| 361 |
|
---|
| 362 | Before:
|
---|
| 363 |
|
---|
| 364 | ```js
|
---|
| 365 | const numbers = doc.children((element) => element.element == 'number');
|
---|
| 366 | ```
|
---|
| 367 |
|
---|
| 368 | After:
|
---|
| 369 |
|
---|
| 370 | ```js
|
---|
| 371 | const numbers = doc.children.filter((element) => element.element == 'number');
|
---|
| 372 | ```
|
---|
| 373 |
|
---|
| 374 | *OR*
|
---|
| 375 |
|
---|
| 376 | ```js
|
---|
| 377 | const numbers = doc.children.findByElement('number');
|
---|
| 378 | ```
|
---|
| 379 |
|
---|
| 380 | - `BaseElement` has been renamed to `Element`.
|
---|
| 381 |
|
---|
| 382 | - Embedded Refract support has been removed.
|
---|
| 383 |
|
---|
| 384 | ### Enhancements
|
---|
| 385 |
|
---|
| 386 | - All elements now contain a `children` and `recursiveChildren` properties that
|
---|
| 387 | return an ArrayElement of the respective children elements.
|
---|
| 388 | - JSON Serialiser will no longer serialise empty `meta` and `attributes` into
|
---|
| 389 | JSON objects.
|
---|
| 390 | - Minim now contains a `RefElement`.
|
---|
| 391 | - Element now contains a `toRef()` function to create a ref element referencing
|
---|
| 392 | the element.
|
---|
| 393 |
|
---|
| 394 | ## 0.16.0 (2017-05-04)
|
---|
| 395 |
|
---|
| 396 | ### Breaking
|
---|
| 397 |
|
---|
| 398 | - Node 0.10 and 0.12 are no longer supported.
|
---|
| 399 | - Elements `name` property was removed. There is no longer a name property in
|
---|
| 400 | Refract specification.
|
---|
| 401 |
|
---|
| 402 | ### Enhancements
|
---|
| 403 |
|
---|
| 404 | - Elements now provide a `findRecursive` method allowing you to recursively
|
---|
| 405 | find matching elements.
|
---|
| 406 | - Added function for remove key in an Object element and Array element
|
---|
| 407 |
|
---|
| 408 | #### Array Element
|
---|
| 409 |
|
---|
| 410 | - New `isEmpty` convenience property for determining if an array is empty.
|
---|
| 411 |
|
---|
| 412 | ## 0.15.0 (2017-04-03)
|
---|
| 413 |
|
---|
| 414 | - Getters of link element will now return an element
|
---|
| 415 | - Meta convenience methods will now return an element
|
---|
| 416 |
|
---|
| 417 | ## 0.14.2 (2016-08-19)
|
---|
| 418 |
|
---|
| 419 | - Update Lodash version
|
---|
| 420 |
|
---|
| 421 | ## 0.14.1 (2016-08-17)
|
---|
| 422 |
|
---|
| 423 | - Update Uptown to 0.4.1
|
---|
| 424 |
|
---|
| 425 | ## 0.14.0 (2016-04-28)
|
---|
| 426 |
|
---|
| 427 | - **BREAKING** The public interface of the `minim` module has changed significantly. List of changes:
|
---|
| 428 |
|
---|
| 429 | - Removed `toCompactRefract` and `fromCompactRefract`
|
---|
| 430 | - Improved the default refract serialization such that when an element in `attributes` has its own metadata or attributes defined then it will now be refracted when calling `toRefract`
|
---|
| 431 |
|
---|
| 432 | ## 0.13.0 (2015-12-03)
|
---|
| 433 |
|
---|
| 434 | - Added support for hyperlinks per [RFC 0008](https://github.com/refractproject/rfcs/blob/b6e390f7bbc960808ba053e172cccd9e4a81a04a/text/0008-add-hyperlinks.md)
|
---|
| 435 | - Upgraded Lodash to 3.10.1
|
---|
| 436 | - Refract elements will be automatically parsed when found in arrays in `meta`
|
---|
| 437 |
|
---|
| 438 | ## 0.12.3 (2015-11-30)
|
---|
| 439 |
|
---|
| 440 | - When an element in `meta` has its own metadata or attributes defined then it will now be refracted when calling `toRefract` or `toCompactRefract`.
|
---|
| 441 | - When loading from refract or compact refract, if an item in `meta` looks like an element it will be loaded as such. This may cause false positives.
|
---|
| 442 |
|
---|
| 443 | ## 0.12.2 (2015-11-24)
|
---|
| 444 |
|
---|
| 445 | - Fix a bug related to setting the default key names that should be treated as refracted elements in element attributes. This is now accomplished via the namespace: `namespace._elementAttributeKeys.push('my-value');`. This fixes bugs related to overwriting the `namespace.BaseElement`.
|
---|
| 446 |
|
---|
| 447 | ## 0.12.1 (2015-11-24)
|
---|
| 448 |
|
---|
| 449 | - Fix a bug when loading refracted attributes from compact refract.
|
---|
| 450 |
|
---|
| 451 | ## 0.12.0 (2015-11-23)
|
---|
| 452 |
|
---|
| 453 | - Provide a way for elements to mark attributes as unrefracted arrays of
|
---|
| 454 | refracted elements. Subclassed elements can push onto the
|
---|
| 455 | `_attributeElementArrayKeys` property to use this feature. **Note**: in the
|
---|
| 456 | future this feature may go away.
|
---|
| 457 | - Allow `load` to be used for plugins where a namespace is not being used
|
---|
| 458 | - Add an `elements` property to the `Namespace` class which returns an object of PascalCased element name keys to registered element class values. This allows for ES6 use cases like:
|
---|
| 459 |
|
---|
| 460 | ```js
|
---|
| 461 | const {StringElement, ArrayElement, ObjectElement} = namespace.elements;
|
---|
| 462 | ```
|
---|
| 463 |
|
---|
| 464 | - Add functionality for Embedded Refract
|
---|
| 465 |
|
---|
| 466 | ## 0.11.0 (2015-09-07)
|
---|
| 467 |
|
---|
| 468 | ### Breaking
|
---|
| 469 |
|
---|
| 470 | The public interface of the `minim` module has changed significantly. List of changes:
|
---|
| 471 |
|
---|
| 472 | - `ElementRegistry` has been renamed to `Namespace`.
|
---|
| 473 | - `minim` has only one public method, called `namespace`, which creates a new `Namespace` instance.
|
---|
| 474 | - `minim.convertToElement` is now `namespace.toElement`
|
---|
| 475 | - `minim.convertFromRefract` is now `namespace.fromRefract`
|
---|
| 476 | - `minim.convertFromCompactRefract` is now `namespace.fromCompactRefract`
|
---|
| 477 | - `minim.*Element` are removed (except for `namespace.BaseElement`). These should be accessed via `namespace.getElementClass('name')` now.
|
---|
| 478 | - The `Namespace` has a new method `use` which loads a plugin namespace and is chainable, e.g. `namespace.use(plugin1).use(plugin2)`.
|
---|
| 479 | - A `Namespace` can be initialized without any default elements by passing an options object with `noDefault` set to `false` to the constructor. They can be initialized later via the `useDefault` method.
|
---|
| 480 |
|
---|
| 481 | Before:
|
---|
| 482 |
|
---|
| 483 | ```js
|
---|
| 484 | var minim = require('minim');
|
---|
| 485 | minim.convertToElement([1, 2, 3]);
|
---|
| 486 | ```
|
---|
| 487 |
|
---|
| 488 | After:
|
---|
| 489 |
|
---|
| 490 | ```js
|
---|
| 491 | var minim = require('minim');
|
---|
| 492 | var namespace = minim.namespace();
|
---|
| 493 | namespace.toElement([1, 2, 3]);
|
---|
| 494 | ```
|
---|
| 495 |
|
---|
| 496 | - Add a `.toValue()` method to member elements which returns a hash with the key
|
---|
| 497 | and value and their respective values.
|
---|
| 498 |
|
---|
| 499 | ## 0.10.0 (2015-08-18)
|
---|
| 500 |
|
---|
| 501 | - Rename the `class` metadata property to `classes`. The convenience property
|
---|
| 502 | is also now called `classes`, e.g. `element.classes.contains('abc')`.
|
---|
| 503 |
|
---|
| 504 | ## 0.9.0 (2015-07-28)
|
---|
| 505 |
|
---|
| 506 | - Allow the iterator protocol to be used with arrays and objects if the runtime
|
---|
| 507 | supports it. This enables using `for ... of` loops on elements as well as
|
---|
| 508 | rest operators, destructuring, `yield*`, etc.
|
---|
| 509 | - Convenience properties for simple types now return the value result. Instead
|
---|
| 510 | of `element.title.toValue()` you now use `element.title`.
|
---|
| 511 | - Add array indexes to `#forEach`.
|
---|
| 512 | - Add a `#clone` method.
|
---|
| 513 | - Add a `#reduce` method.
|
---|
| 514 | - Fix a serialization bug when initializing using falsey values
|
---|
| 515 | (`null`, `0`, `false`).
|
---|
| 516 |
|
---|
| 517 | ## 0.8.0 (2015-07-09)
|
---|
| 518 |
|
---|
| 519 | - Allow `#set` to take an object for Object Elements
|
---|
| 520 | - Convert `meta` to be Minim Object Elements
|
---|
| 521 | - Convert `attributes` to be Minim Object Elements
|
---|
| 522 | - Sync class and method names with Refract 0.2.0 spec
|
---|
| 523 | - Add convenience methods for `meta` attributes, such as `id` or `class`
|
---|
| 524 | - Add finder functions, such as `findByElement` and `findByClass`
|
---|
| 525 | - Upgrade to use Uptown 0.4.0
|
---|
| 526 | - Organize code
|
---|