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

Remove deprecated middleware actions #311

Merged
merged 4 commits into from
Nov 20, 2019
Merged

Conversation

alecgibson
Copy link
Collaborator

@alecgibson alecgibson commented Sep 18, 2019

Fixes #310

We previously deprecated the doc and after submit
middleware actions in favour of readSnapshots and afterSubmit
respectively.

In preparation for the breaking v1.0 release, this change removes these
deprecated middlewares and their associated shims.

We previously deprecated the [`doc`][1] and [`after submit`][2]
middleware actions in favour of `readSnapshots` and `afterSubmit`
respectively.

In preparation for the breaking v1.0 release, this change removes these
deprecated middlewares and their associated shims.

[1]: #209
[2]: #212
@coveralls
Copy link

coveralls commented Sep 18, 2019

Coverage Status

Coverage decreased (-0.03%) to 96.772% when pulling 8c70c4c on remove-deprecated-middleware into 1a483b7 on master.

@ericyhwang
Copy link
Contributor

I resolved the merge conflicts by updating this to reflect the "afterSubmit" -> "afterWrite" rename in #314.

Copy link
Contributor

@nateps nateps left a comment

Choose a reason for hiding this comment

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

LGTM! 💅

@nateps nateps merged commit 14bfd34 into master Nov 20, 2019
@nateps nateps deleted the remove-deprecated-middleware branch November 20, 2019 18:27
alecgibson added a commit to alecgibson/DefinitelyTyped that referenced this pull request Jan 14, 2021
This change adds support for the [`suppressPublish`][1] and
[`maxSubmitRetries`][2] options.

We also mark `disableDocAction` and `disableSpaceDelimitedActions` as
deprecated, because these were [removed][3].

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L33
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L34
[3]: share/sharedb#311
alecgibson added a commit to alecgibson/DefinitelyTyped that referenced this pull request Jan 14, 2021
This change adds support for the [`suppressPublish`][1] and
[`maxSubmitRetries`][2] options.

We also mark `disableDocAction` and `disableSpaceDelimitedActions` as
deprecated, because these were [removed][3].

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L33
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L34
[3]: share/sharedb#311
alecgibson added a commit to alecgibson/DefinitelyTyped that referenced this pull request Jan 20, 2021
This change adds support for the [`suppressPublish`][1] and
[`maxSubmitRetries`][2] options.

We also mark `disableDocAction` and `disableSpaceDelimitedActions` as
deprecated, because these were [removed][3].

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L33
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L34
[3]: share/sharedb#311
typescript-bot pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Jan 20, 2021
* [sharedb] Server event support

This change makes the default `sharedb` class extend `EventEmitter`,
like it does [in the library][1].

We also add support for the [`error`][2] and [`timing`][3] events.

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L21
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L91
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L220

* [sharedb] Add MilestoneDB support

The `Backend` options allow specifying a [`milestoneDb`][1], which is an
instance of [`MilestoneDB`][2].

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L28
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/milestone-db/index.js#L7

* [sharedb] Update Backend options

This change adds support for the [`suppressPublish`][1] and
[`maxSubmitRetries`][2] options.

We also mark `disableDocAction` and `disableSpaceDelimitedActions` as
deprecated, because these were [removed][3].

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L33
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L34
[3]: share/sharedb#311

* [sharedb] Update Doc definitions

This change makes multiple fixes to the `Doc` definition:

 - Add [`subscribed`][1], [`preventCompose`][2] and [`paused`][3]
  properties
 - Add [`unsubscribe()`][4]
 - Allow a callback in [`destroy()`][5]
 - Remove the error argument from [`whenNothingPending()`][6], since that
   method will never call the callback with an error
 - Add [`hasPending()`][7], [`hasWritePending()`][8], [`pause()`][9],
   [`resume()`][10] and [`flush()`][11] methods

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L73
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L104
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L109
[4]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L424
[5]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L113
[6]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L221
[7]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L232
[8]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L243
[9]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L901
[10]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L906
[11]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L500

* [sharedb] Snapshots

ShareDB allows clients to fetch snapshots through:

 - [`fetchSnapshot`][1]
 - [`fetchSnapshotByTimestamp`][2]

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L660
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L688

* [sharedb] Generic Doc and Snapshot

The `Doc` and `Snapshot` types are both data wrappers around a
potentially well-structured object.

This change makes these types optionally generic (defaulting to `any`
if no type is provided), allowing clients to enforce stricter type
checking on these types if they wish.

* [sharedb] Update middleware hooks

The `afterSubmit` hook was [replaced with `afterWrite`][1].

[1]: share/sharedb#314

* [sharedb] Logger method overrides

ShareDB exposes a special [`Logger`][1], which can be used to override
ShareDB's internal logging calls, which default to using the `console`.

There are two logger instances that can be configured:

 - [server-side][2]
 - [client-side][3]

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/logger/logger.js#L7
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/index.js#L8
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/index.js#L6

* [sharedb] Presence support

ShareDB supports "presence", which is accessed through
[`getPresence`][1] and [`getDocPresence`][2], both of which return an
instance of [`Presence`][3].

This functionality is hidden behind a [feature flag][4], which is also
included in this change.

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L751
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L758
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/presence/presence.js#L8
[4]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L35

* [sharedb] Update authors

* Review markups

 - Fix bad merge: `disableDocAction` is the deprecated field.
 - Make `Doc` callbacks optional
 - Rename `ReceivePresence` to a more obvious name
kaznovac pushed a commit to kaznovac/DefinitelyTyped that referenced this pull request Mar 2, 2021
* [sharedb] Server event support

This change makes the default `sharedb` class extend `EventEmitter`,
like it does [in the library][1].

We also add support for the [`error`][2] and [`timing`][3] events.

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L21
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L91
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L220

* [sharedb] Add MilestoneDB support

The `Backend` options allow specifying a [`milestoneDb`][1], which is an
instance of [`MilestoneDB`][2].

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L28
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/milestone-db/index.js#L7

* [sharedb] Update Backend options

This change adds support for the [`suppressPublish`][1] and
[`maxSubmitRetries`][2] options.

We also mark `disableDocAction` and `disableSpaceDelimitedActions` as
deprecated, because these were [removed][3].

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L33
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L34
[3]: share/sharedb#311

* [sharedb] Update Doc definitions

This change makes multiple fixes to the `Doc` definition:

 - Add [`subscribed`][1], [`preventCompose`][2] and [`paused`][3]
  properties
 - Add [`unsubscribe()`][4]
 - Allow a callback in [`destroy()`][5]
 - Remove the error argument from [`whenNothingPending()`][6], since that
   method will never call the callback with an error
 - Add [`hasPending()`][7], [`hasWritePending()`][8], [`pause()`][9],
   [`resume()`][10] and [`flush()`][11] methods

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L73
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L104
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L109
[4]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L424
[5]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L113
[6]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L221
[7]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L232
[8]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L243
[9]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L901
[10]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L906
[11]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/doc.js#L500

* [sharedb] Snapshots

ShareDB allows clients to fetch snapshots through:

 - [`fetchSnapshot`][1]
 - [`fetchSnapshotByTimestamp`][2]

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L660
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L688

* [sharedb] Generic Doc and Snapshot

The `Doc` and `Snapshot` types are both data wrappers around a
potentially well-structured object.

This change makes these types optionally generic (defaulting to `any`
if no type is provided), allowing clients to enforce stricter type
checking on these types if they wish.

* [sharedb] Update middleware hooks

The `afterSubmit` hook was [replaced with `afterWrite`][1].

[1]: share/sharedb#314

* [sharedb] Logger method overrides

ShareDB exposes a special [`Logger`][1], which can be used to override
ShareDB's internal logging calls, which default to using the `console`.

There are two logger instances that can be configured:

 - [server-side][2]
 - [client-side][3]

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/logger/logger.js#L7
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/index.js#L8
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/index.js#L6

* [sharedb] Presence support

ShareDB supports "presence", which is accessed through
[`getPresence`][1] and [`getDocPresence`][2], both of which return an
instance of [`Presence`][3].

This functionality is hidden behind a [feature flag][4], which is also
included in this change.

[1]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L751
[2]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/connection.js#L758
[3]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/client/presence/presence.js#L8
[4]: https://github.com/share/sharedb/blob/30badb22192eb04e43f983772058fb129598de51/lib/backend.js#L35

* [sharedb] Update authors

* Review markups

 - Fix bad merge: `disableDocAction` is the deprecated field.
 - Make `Doc` callbacks optional
 - Rename `ReceivePresence` to a more obvious name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.0.0] Remove middleware shims
4 participants