-
Notifications
You must be signed in to change notification settings - Fork 56
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
[SDK-3936] Remove remaining REST code from BaseRealtime
#1496
Merged
lawrence-forooghian
merged 5 commits into
integration/v2
from
1489-remove-remaining-REST-code-from-BaseRealtime
Nov 21, 2023
Merged
[SDK-3936] Remove remaining REST code from BaseRealtime
#1496
lawrence-forooghian
merged 5 commits into
integration/v2
from
1489-remove-remaining-REST-code-from-BaseRealtime
Nov 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13841cb
to
a9d85a5
Compare
a9d85a5
to
cf1d07a
Compare
BaseRealtime
BaseRealtime
d6902d0
to
9976a84
Compare
List all of the functionality that’s gated off by this module and check that it works when the module is provided, and doesn’t when it’s not. Also test that Realtime doesn’t need this module in order to publish and subscribe.
Not having to deal with the overload signature will make an upcoming refactor easier.
I consider this to be REST functionality, and so to reduce bundle size it shouldn’t be bundled with a BaseRealtime client. I should have done this in 89c0761.
Groundwork for removing the Realtime versions’ inheritance.
There is code that’s exclusively needed by the REST version of these classes (e.g. presence `get()`, channel `publish()`), and which, in order to reduce bundle size, we don’t want to pull in when importing the BaseRealtime class. In order to do this, we need to sever the inheritance relation between the Realtime and REST version of these classes. (It’s also worth noting that, similarly to what I mentioned in 69c35f1, the IDL doesn’t mention any inheritance relation.) The REST versions of these classes also contain functionality (channel history and presence history, channel status) that should only be available to a BaseRealtime client if the user has explicitly requested REST functionality (by importing the Rest module). So, we gate this functionality behind the Rest module (I should really have done this in 89c0761) and in doing so further reduce the bundle size of a REST-less BaseRealtime. I’ve moved the channel and presence REST code that’s also conditionally needed by Realtime into classes called RestChannelMixin and RestPresenceMixin. There’s no massively compelling reason for these classes to exist, I just thought it might be good not to dump everything directly inside the Rest module. Resolves #1489.
cf1d07a
to
b75eb5b
Compare
owenpearson
approved these changes
Nov 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This PR is based on top of #1476; please review that one first.
This adds further testing around how
BaseRealtime
behaves when you do and don't provide theRest
module, and then addresses the REST-related code thatBaseRealtime
was pulling in even when theRest
module was not provided. See commit messages for more details.Resolves #1489.