---
title: Upgrade v2 to v3
order: 2
---

# Upgrade from v2 to v3

[TOC]

---

This update introduces the biggest change to Bard Mutator since its first release. There are some significant changes to the terminology and variables used in mutators, however there are only two very small breaking changes. All existing mutators should still work exactly as before, but it’s advised to familiarise yourself with the new APIs and terminology, and migrate your existing mutators to the new conventions when you have time. Support for the old APIs may be removed in future. 

The terminology changes are:

* Mutators are now known as plugins
* The `$data` object is now called `$item`
* The `$meta` array is now an object called `$info`

All documentation, examples and the rest of this upgrade guide use this new terminology.

---

## Breaking Changes

### Editor class binding removed (High Impact)

It is no longer necessary to bind a custom Tiptap Editor class in order to use advanced features, and Bard Mutator's Editor class has been removed. If you enabled this you should remove it from your app service provider's `register()` method:

```diff
-$this->app->bind(
-    \Tiptap\Editor::class,
-    \JackSleight\StatamicBardMutator\Editor::class
-);
```

### New node/mark creation (High Impact)

If you're creating new nodes or marks in data plugins you should use the new `node` and `mark` helpers provided by the Data support class.

```php
$node = (object) [
    'type' => 'paragraph',
    'attrs' => (object) [
        'class' => 'text-base',
    ],
];
```
```php
use JackSleight\StatamicBardMutator\Support\Data;

$node = Data::node('paragraph', [
    'class' => 'text-base',
]);
```

You can also use the `apply`, `clone` and `morph` helpers, depending on what you're trying to do. Check the [helpers](helpers) page for more information.

### Deprecated method removed (Low Impact)

The previously deprecated `Mutator::tag()` method has been removed. You should use `Mutator::html()` instead.

---

## Deprecated

### Metadata argument

The `$meta` argument that contains information about the current node or mark has been superseded by the `$info` argument. This is an object instead of an array.

### Data argument

The `$data` argument that contains the source node or mark object has been superseded by the `$item` argument.

### Individual render/parse HTML methods

The individual `Mutator::renderHtml()` and `Mutator::parseHtml()` methods have been deprecated. These were never documented so it's unlikely anyone is using them, and they were just aliases for `Mutator::html()` anyway.

### Reverse HTML mutators

Reverse HTML mutators have been deprecated and will be removed in a future version. They never really made sense, they can’t work with the new scoped plugins feature, and as far as I’m aware no one’s using them anyway.