-
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-3857] Add typings for the tree-shakable version of the library #1498
Merged
lawrence-forooghian
merged 5 commits into
integration/v2
from
1442-add-typings-for-tree-shakable-version
Nov 21, 2023
Merged
[SDK-3857] Add typings for the tree-shakable version of the library #1498
lawrence-forooghian
merged 5 commits into
integration/v2
from
1442-add-typings-for-tree-shakable-version
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
github-actions
bot
temporarily deployed
to
staging/pull/1498/features
November 10, 2023 20:29
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/typedoc
November 10, 2023 20:30
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/bundle-report
November 10, 2023 20:31
Inactive
lawrence-forooghian
force-pushed
the
1442-add-typings-for-tree-shakable-version
branch
from
November 13, 2023 13:15
997a9b0
to
61645ad
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1498/features
November 13, 2023 13:15
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/bundle-report
November 13, 2023 13:16
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/typedoc
November 13, 2023 13:17
Inactive
lawrence-forooghian
changed the title
1442 add typings for tree shakable version
Add typings for the tree-shakable version of the library
Nov 13, 2023
lawrence-forooghian
changed the title
Add typings for the tree-shakable version of the library
[SDK-3719] Add typings for the tree-shakable version of the library
Nov 13, 2023
lawrence-forooghian
changed the title
[SDK-3719] Add typings for the tree-shakable version of the library
[SDK-3857] Add typings for the tree-shakable version of the library
Nov 13, 2023
lawrence-forooghian
force-pushed
the
1442-add-typings-for-tree-shakable-version
branch
from
November 13, 2023 13:24
61645ad
to
3463ae3
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1498/features
November 13, 2023 13:24
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/typedoc
November 13, 2023 13:25
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/bundle-report
November 13, 2023 13:25
Inactive
lawrence-forooghian
force-pushed
the
1442-add-typings-for-tree-shakable-version
branch
from
November 14, 2023 18:42
3463ae3
to
2ccb5eb
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1498/features
November 14, 2023 18:43
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/typedoc
November 14, 2023 18:44
Inactive
lawrence-forooghian
force-pushed
the
1442-add-typings-for-tree-shakable-version
branch
from
November 14, 2023 18:44
2ccb5eb
to
869be09
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1498/features
November 14, 2023 18:44
Inactive
github-actions
bot
temporarily deployed
to
staging/pull/1498/bundle-report
November 14, 2023 18:45
Inactive
lawrence-forooghian
force-pushed
the
1489-remove-remaining-REST-code-from-BaseRealtime
branch
from
November 14, 2023 19:04
cf1d07a
to
b75eb5b
Compare
These declarations are unreachable via the typings. The user needs to access these methods via the MessageStatic and PresenceMessageStatic interfaces.
These declarations are unreachable via the typings.
This allows users to import the module-based version by writing ``` import { BaseRealtime } from 'ably/modules' ``` instead of having to import 'ably/build/modules'. I followed the guidance in [1] and [2]. [1] https://nodejs.org/api/packages.html#exports [2] https://webpack.js.org/guides/package-exports/
I wasn’t sure of the best way to approach the typings of the modules (`Rest` etc). They should be opaque to the user (they shouldn’t be interacting with them directly and we want be free to change their interface in the future). There is an open issue to add support for opaque types to TypeScript [1], and people have suggested various sorts of ways of approximating them, which revolve around the use of `unique symbol` declarations. However, I don’t fully understand these solutions and so thought it best not to include them in our public API. So, for now, let’s just use `unknown`, the same way as we do for `CipherParams.key`. Resolves #1442. [1] microsoft/TypeScript#202
lawrence-forooghian
force-pushed
the
1442-add-typings-for-tree-shakable-version
branch
from
November 14, 2023 19:05
869be09
to
b839715
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1498/typedoc
November 14, 2023 19:06
Inactive
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.
Looks great!
Base automatically changed from
1489-remove-remaining-REST-code-from-BaseRealtime
to
integration/v2
November 21, 2023 00:17
lawrence-forooghian
deleted the
1442-add-typings-for-tree-shakable-version
branch
November 21, 2023 00:18
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 #1496; please review that one first.
This changes the way that the package does its exports, so that the user can import
ably/modules
, and then adds typings for the library that you get when you do this import. See commit messages for more details.Resolves #1442.