Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/prepare 2.0.0 release #18

Merged
merged 5 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## Unreleased
## [2.0.0] # 2018-11-19
### Breaking changes
**Changed default usage of form fields**
In order to provide the best typescript experience we had to ditch the conect of `<Field component={Input}>`. From version 2.0.0 onwards the field component is used directly, e.g.: `<Input name="demo" label="Demo Input" />`. The field component will still accept the field props. Developers who want to make their own field components now need to wrap those with the new `withField` higher order component. A full migration guide will be available soon.

### Other
- Removed deprecated Form.onFieldValueChanged callback
- Removed deprecated `Form.onFieldValueChanged` callback
- Fixed a bug where a form field would revert its value to '' if its current value evaulated to value == false.
- Added `isRequired` to field meta. It is true if the field / input component contains a required validator.

Expand Down
25 changes: 25 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,28 @@ Then use the form where needed.

## Documentation and Showcase
[API Documentation and Showcase](https://environment-agency-austria.github.io/forms-showcase/#/)

## Upgrading from react-ocean-forms 1.x.x to 2.0.0
From version 2.0.0 onwards the syntax for `Field` has changed. Previously a field would be written like this:

**Before**:
```jsx
<Field
name="demo"
label="My demo field"
component={Input}
/>
```

**After**:
```jsx
<Input
name="demo"
label="My demo field"
/>
```

The input component is now used directly without using it in the component prop of the field.

### Changes for writing custom field components
Custom field components must use the new `withField` higher order component. See [Input.tsx](./src/components/Input/Input.tsx) for an implementation example.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-ocean-forms",
"version": "2.0.0-rc3",
"version": "2.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙂🎉🍾

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release train is rolling
🚅 choo choo

"description": "Forms components for react based on the context api.",
"main": "build/index.js",
"typings": "build/index.d.ts",
Expand All @@ -11,7 +11,7 @@
"test:coverage": "jest --coverage",
"start": "webpack --watch --mode development",
"build": "webpack -p",
"lint": "tslint --project ."
"lint": "tslint -t stylish --project ."
},
"jest": {
"setupFiles": [
Expand Down Expand Up @@ -51,24 +51,24 @@
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/plugin-transform-react-jsx": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@types/enzyme": "^3.1.15",
"@types/enzyme-adapter-react-16": "^1.0.3",
"@types/jest": "^23.3.9",
"@types/react": "^16.4.18",
"@types/react": "^16.7.6",
"babel-loader": "^8.0.4",
"babel-runtime": "^6.26.0",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"clean-webpack-plugin": "^1.0.0",
"coveralls": "^3.0.2",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"enzyme-adapter-react-16": "^1.7.0",
"jest": "^23.6.0",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"ts-jest": "^23.10.4",
"ts-loader": "^5.3.0",
"tslint": "^5.11.0",
Expand All @@ -77,7 +77,7 @@
"tslint-microsoft-contrib": "^5.2.1",
"tslint-react": "^3.6.0",
"typescript": "^3.1.6",
"webpack": "^4.25.1",
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ ShallowWrapper {
"_currentRenderer2": null,
"_currentValue": undefined,
"_currentValue2": undefined,
"_threadCount": 0,
},
},
},
Expand Down Expand Up @@ -218,6 +219,7 @@ ShallowWrapper {
"_currentRenderer2": null,
"_currentValue": undefined,
"_currentValue2": undefined,
"_threadCount": 0,
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/components/Form/__snapshots__/Form.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ ShallowWrapper {
"_currentRenderer2": null,
"_currentValue": undefined,
"_currentValue2": undefined,
"_threadCount": 0,
},
},
},
Expand Down Expand Up @@ -195,6 +196,7 @@ ShallowWrapper {
"_currentRenderer2": null,
"_currentValue": undefined,
"_currentValue2": undefined,
"_threadCount": 0,
},
},
},
Expand Down
Loading