Skip to content

Commit

Permalink
0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
markalfred committed Aug 10, 2018
1 parent fdc6344 commit 8664449
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
47 changes: 24 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,36 @@
<summary>
Changes that have landed in master but are not yet released.
</summary>
Breaking Changes:
</details>

## 0.4.0 (August 10, 2018)
Breaking Changes:

* Default generators now produce values that match their `propName`.
```js
generate({ foo: PropType.string, bar: PropTypes.object })
// Old: => { foo: 'string', bar: {} }
// New: => { foo: 'foo', bar: { bar: 'bar' } }
```
* #21 - Default generators now produce values that match their `propName`.
```js
generate({ foo: PropType.string, bar: PropTypes.object })
// Old: => { foo: 'string', bar: {} }
// New: => { foo: 'foo', bar: { bar: 'bar' } }
```

* Generator callbacks now receive `propName` as their first argument, and their definitions' argument as the second.
* `generateProps.init()` *must* be called prior to components being imported or `generateProps()` being called.
* #21 - Generator callbacks now receive `propName` as their first argument, and their definitions' argument as the second.

Non-breaking Changes:
* #19 - `generateProps.init()` *must* be called prior to components being imported or `generateProps()` being called.

* Generator callbacks now receive the `propName` as an argument.
Non-breaking Changes:

* Fixed: Deeply nested props wouldn't respect opts argument.
```js
generate({
foo: PropType.shape({
bar: PropType.shape({
baz: PropType.string
})
* #17 - Fixed: Deeply nested props wouldn't respect opts argument.
```js
generate({
foo: PropType.shape({
bar: PropType.shape({
baz: PropType.string
})
}, { optional: true })
// Old: => { foo: {} }
// New: => { foo: { bar: { baz: 'baz' } } }
```
</details>
})
}, { optional: true })
// Old: => { foo: {} }
// New: => { foo: { bar: { baz: 'baz' } } }
```

## 0.3.0 (October 5, 2017)
* Generators are now deterministic by default. Previously, snapshot tests might break if `oneOf` or `oneOfType` were used.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-generate-props",
"version": "0.3.0",
"version": "0.4.0",
"description": "Generate default props based on your React component's PropTypes",
"main": "dist/main.js",
"engines": {
Expand Down

0 comments on commit 8664449

Please sign in to comment.