# 1.4.x → 1.5.x

Release `1.5` includes crucial architecture rewrite to allow new features in the future.

## Removed ImmutableJS

ImmutableJS is no longer a peer dependency of React Advanced Form. Having `react` alone is now sufficient to use your favorite form library!

{% hint style="success" %}
Uninstall `immutable` package from your project in case you do not use it.
{% endhint %}

## Deprecated `withImmutable`

Consequentially after removing immutable from library's dependencies, we deprecated the usage of immutable instances in various callback methods provided by the form. Please use plain JavaScript data types from now on.

`FormProvider` and `Form` components no longer support `withImmutable` prop.

#### Before:

```jsx
const registerUser = ({ fields }) => {
  /* "fields" is the instance of Immutable.Map */
  const username = fields.get('username')
  const value = username.get('value')
}

<Form action={registerUser} withImmutable>
  <Input name="username" />
</Form>
```

#### After:

```jsx
const registerUser = ({ fields }) => {
  /* "fields" is a plain Object */
  const { username } = fields
  const { value } = username
}

<Form action={registerUser}>
  <Input name="username" />
</Form>
```

{% hint style="success" %}
Remove `withImmutable` prop and (optionally) re-write the usage of immutable instances in callback arguments to use plain JavaScript primitives.
{% endhint %}

## Deprecated `fields` in rule resolvers

A rule resolver that references another field is expected to become [reactive](https://redd.gitbook.io/react-advanced-form/architecture/reactive-props#reactive-validation-rules). Previously, we have used Proxy on fields Object to flush the references fields. However, to enable at least IE11 support we reworked the functionality and introduces a dedicated `get` function for reactive field references.

```jsx
const validationRules = {
  name: {
    confirmPassword: ({ get, value, fieldProps, form }) => {
      return (value === get(['password']))
    },
  },
}
```

{% hint style="success" %}
Replace `fields.foo.bar` by `get(['foo', 'bar'])` in the validation rules resolvers.
{% endhint %}

## Changed `fieldProps.ref`

The reference to a field component is now available via `fieldProps.getRef()`.

#### Before:

```jsx
const validateUsername = ({ fieldProps }) => {
  const field = fieldProps.ref
}

<Input
  name="username"
  rule={validateUsername} />
```

#### After:

```jsx
const validateUsername = ({ fieldProps }) => {
  const field = fieldProps.getRef()
}

<Input
  name="username"
  rule={validateUsername} />
```

{% hint style="info" %}
Replace `fieldProps.ref` by `fieldProps.getRef()` whenever it has been used.
{% endhint %}
