Skip to content

Commit fab7dae

Browse files
committed
Update docs
1 parent 8eaea0b commit fab7dae

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/upgrade-2-0-to-3-0.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,29 @@ It is no longer necessary to bind a custom Tiptap Editor class in order to use a
3232
-);
3333
```
3434

35+
### New node/mark creation (High Impact)
36+
37+
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. eg. Instead of:
38+
39+
```php
40+
$node = (object) [
41+
'type' => 'paragraph',
42+
'attrs' => (object) [
43+
'class' => 'text-base',
44+
],
45+
];
46+
```
47+
48+
You should now do:
49+
50+
```php
51+
use JackSleight\StatamicBardMutator\Support\Data;
52+
53+
$node = Data::node('paragraph', [
54+
'class' => 'text-base',
55+
]);
56+
```
57+
3558
### Deprecated method removed (Low Impact)
3659

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

0 commit comments

Comments
 (0)