Skip to content

Commit 11aec0e

Browse files
vinogradovjdecked
vinogradov
authored andcommitted
Docs: add explicit deprecation notes to Entity methods (facebookarchive#1787)
Summary: **Summary** The note in the docs `Please note that the API for entity storage and management has changed recently; for details on updating your application see our v0.10 API Migration Guide` doesn't give a quick clear idea of what I should use instead of the old methods (I need to go to that migration guide, but let's suppose I'm a new user and I don't have any code to migrate). The problem becomes obvious after getting warnings in the browser console. So my suggestion is to place deprecation notice right in the name header. I believe this would save some time for those who open docs just to see the method signatures. Now (https://draftjs.org/docs/api-reference-entity.html): ![image](https://user-images.githubusercontent.com/439939/41491613-39a1cfb2-710b-11e8-849b-4f8a13bf9088.png) What I suggest: ![image](https://user-images.githubusercontent.com/439939/41491621-43f89af4-710b-11e8-8d71-2c3c20054e42.png) Pull Request resolved: facebookarchive#1787 Differential Revision: D10234733 fbshipit-source-id: 8f7c32ad4f0da203ffe0a80584781413681ba158
1 parent 451ad6c commit 11aec0e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/APIReference-Entity.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ be used only for retrieval.
5353

5454
## Methods
5555

56-
### create
56+
### create _(Deprecated in favour of [contentState.createEntity](/docs/api-reference-content-state.html#createentity))_
5757

5858
```
5959
create(
@@ -70,7 +70,7 @@ are referenced by their string key in `ContentState`. The string value should
7070
be used within `CharacterMetadata` objects to track the entity for annotated
7171
characters.
7272

73-
### add
73+
### add _(Deprecated in favour of [contentState.addEntity](/docs/api-reference-content-state.html#addentity))_
7474

7575
```
7676
add(instance: DraftEntityInstance): string
@@ -83,15 +83,15 @@ created, and now need to be added to the `Entity` store. This may occur in cases
8383
where a vanilla JavaScript representation of a `ContentState` is being revived
8484
for editing.
8585

86-
### get
86+
### get _(Deprecated in favour of [contentState.getEntity](/docs/api-reference-content-state.html#getentity))_
8787

8888
```
8989
get(key: string): DraftEntityInstance
9090
```
9191
Returns the `DraftEntityInstance` for the specified key. Throws if no instance
9292
exists for that key.
9393

94-
### mergeData
94+
### mergeData _(Deprecated in favour of [contentState.mergeEntityData](/docs/api-reference-content-state.html#mergeentitydata))_
9595

9696
```
9797
mergeData(
@@ -104,7 +104,7 @@ metadata through typical mutative means.
104104

105105
The `mergeData` method allows you to apply updates to the specified entity.
106106

107-
### replaceData
107+
### replaceData _(Deprecated in favour of [contentState.replaceEntityData](/docs/api-reference-content-state.html#replaceentitydata))_
108108

109109
```
110110
replaceData(

0 commit comments

Comments
 (0)