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

[SDK-3734] Make HTTP request implementations tree-shakable #1438

Merged
merged 9 commits into from
Nov 21, 2023

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Sep 14, 2023

Note: This PR is based on top of #1432; please review that one first.

This exposes tree-shakable XHRRequest and FetchRequest modules.

The user is required to provide an HTTP module, even for Realtime, since it’s used for the internet connectivity check and for making a token request to the authUrl.

See commit messages for more details.

Resolves #1395.

@github-actions github-actions bot temporarily deployed to staging/pull/1438/features September 14, 2023 12:46 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report September 14, 2023 12:47 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc September 14, 2023 12:47 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1394-tree-shakable-transports branch from 14424f1 to 1feb6e3 Compare September 14, 2023 12:54
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features September 14, 2023 12:54 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc September 14, 2023 12:55 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report September 14, 2023 12:55 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features October 25, 2023 20:41 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report October 25, 2023 20:42 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc October 25, 2023 20:42 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1394-tree-shakable-transports branch from 1feb6e3 to 23c83d9 Compare October 26, 2023 14:33
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features October 26, 2023 16:24 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report October 26, 2023 16:25 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc October 26, 2023 16:25 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1394-tree-shakable-transports branch from 23c83d9 to b66c87b Compare October 26, 2023 16:52
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features October 26, 2023 17:05 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc October 26, 2023 17:06 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report October 26, 2023 17:07 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1394-tree-shakable-transports branch 3 times, most recently from d2d5199 to 1c61527 Compare October 26, 2023 18:00
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features October 26, 2023 19:07 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features October 26, 2023 19:15 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report October 26, 2023 19:16 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc November 8, 2023 17:51 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report November 8, 2023 17:51 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features November 8, 2023 18:20 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc November 8, 2023 18:20 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report November 8, 2023 18:20 Inactive
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review November 9, 2023 12:53
Copy link
Member

@owenpearson owenpearson left a comment

Choose a reason for hiding this comment

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

Looks good! I think we maybe ought to consider making fetch the default in v2 but that's a separate conversation anyway

@lawrence-forooghian lawrence-forooghian force-pushed the 1394-tree-shakable-transports branch from d986ea2 to d7f9bd5 Compare November 14, 2023 18:50
(I’m also not sure why the compiler was accepting the code that
described the `body` parameter as having type `any`, given that in
BodyHandler it’s of type `unknown`.)
This fixes some compilation errors that were missed by the fact that it
was a .d.ts file. (See #1445 for the issue that aims to convert all
.d.ts files to .ts.)

This improved type information introduced a compiler error resulting
from us trying to directly access HTTP headers on DOM’s Headers object
with header names as object property names. I can’t see how the existing
code could have been working properly, so I’ve changed the response
header handling in fetchrequest.ts.
Similar to that used for transports.
To correctly reflect the fact that the tests instantiate Platform.Http
without any arguments.
Preparation for tree-shakable HTTP request implementations, which will
be exposed via the client. The constructor needs access to the list of
available request implementations so that it can populate the
supportsAuthHeaders property.
We expose XHRRequest and FetchRequest modules.

The user is required to provide an HTTP module, even for Realtime, since
it’s used for the internet connectivity check and for making a token
request to the authUrl.

Resolves #1395.
@github-actions github-actions bot temporarily deployed to staging/pull/1438/features November 14, 2023 18:51 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/typedoc November 14, 2023 18:52 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1438/bundle-report November 14, 2023 18:52 Inactive
lawrence-forooghian and others added 3 commits November 14, 2023 15:53
In preparation for #1397 (making MessageFilter functionality
tree-shakable).
We expose a MessageIteractions module which allows users to pass a
MessageFilter object to RealtimeChannel’s `subscribe` and `unsubscribe`.

Resolves #1397.
…ions

[SDK-3736] Make `MessageFilter` subscription filtering tree-shakable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants