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

[EDX-149] Add canonical docstring comments #1026

Merged

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Jul 6, 2022

What does this do?

Incorporates the canonical docstrings from https://github.com/ably/canonical-api-reference-prototyping/blob/main/descriptions.md into our TypeScript declarations files.

At the time of writing, this pull request has 478 commits, which means that GitHub won't show you all the commits in the "Commits" view (only the most recent 250). To view them all, see integration/docs...EDX-149-add-canonical-docstring-comments.

How to review this pull request

I've structured this pull request (see below) so that it's easy to review commit-by-commit. The commit messages contain lots of explanation of the decisions I’ve made.

Please note that I am seeking review of how I have incorporated the canonical docstrings into ably-js – that is, how I have prepared the JS codebase for adding the canonical docstrings, and then how I edited the canonical docstrings to make sense for JS. I am not seeking review of the original canonical docstrings themselves. If you have comments on the content of the canonical docstrings, please raise them as issues in https://github.com/ably/canonical-api-reference-prototyping.

Structure of this pull request

  1. Commits f889b4b to 6cbd4d5 inclusive: Prepare our TypeScript declarations files so that they're ready to have the canonical docstrings added to them. This includes things like splitting a single method signature into multiple overloads so that they can be documented individually.
  2. Commit 8b19aa0: Adding markers to delimit any existing ("legacy") docstrings, so that we can later distinguish them from the canonical docstrings.
  3. Commits 169b9f5 to 51a1219 inclusive: Adding the canonical docstrings, verbatim, to the TypeScript declarations files.
  4. Commits edc754c to 5c1ea03 inclusive: Fixing what I believe to be mistakes in the canonical docstrings. Specifically, these are mistakes that have blocked me in some way from progressing with this work. At some point, the tech writers will likely incorporate these suggested changes into the canonical docstrings.
  5. Commits b803343 to 023226a inclusive: Editing the added canonical docstrings so that they are correct for this SDK.
  6. Commits 7fc0c55 to 668200c: Checking the edited canonical docstrings and removing the markers that I’d used to help me.

(I made a video explaining this, but it's more aimed at who I thought was going to take this work over from me, which didn't happen in the end. If you're interested – you probably shouldn't be, it's long – then it's here.)

Next steps after merging this pull request but before merging integration/docs into main

  • Address all of the remaining LEGACY DOCSTRING markers that this pull request introduces into the .d.ts files. Some of these outstanding ones are because of things that should have canonical documentation but don't yet (which hopefully will be addressed in the aforementioned v2 of canonical docstrings), and some are ably-js specific things. We should write our own docstrings for the latter (and get tech writers to review them, I think).
  • Address all of the remaining "Not yet documented" docstrings in the .d.ts files. The reasons that these might exist are similar to those for the LEGACY DOCSTRING ones. Also ably-js has quite a few method overloads that are very similar to those described by the canonical documentation, but not quite. We should document those ones, basing our documentation on the canonical strings.
  • Add intro blurb (EDX-207) - awaiting review in [EDX-207] Add intro blurb to generated documentation #1055
  • Merge main into integration/docs and address merge conflicts and add documentation for things that have been added to main recently.

@lawrence-forooghian lawrence-forooghian changed the base branch from integration/docs to EDX-158-generate-docs-with-TypeDoc July 6, 2022 15:01
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 6, 2022 15:03 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 6, 2022 15:03 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 6, 2022 19:31 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 6, 2022 19:31 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 6, 2022 19:51 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 6, 2022 19:52 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the EDX-149-add-canonical-docstring-comments branch from 55003c3 to c9b0cd9 Compare July 6, 2022 19:57
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 6, 2022 19:59 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 6, 2022 20:00 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 6, 2022 20:27 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the EDX-149-add-canonical-docstring-comments branch from 85457de to b127e90 Compare July 7, 2022 18:24
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 7, 2022 18:26 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 7, 2022 18:26 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the EDX-158-generate-docs-with-TypeDoc branch from 542ee54 to 33ef1c4 Compare July 7, 2022 19:01
Base automatically changed from EDX-158-generate-docs-with-TypeDoc to integration/docs July 8, 2022 07:32
@lawrence-forooghian lawrence-forooghian changed the title Edx 149 add canonical docstring comments [EDX-149] Add canonical docstring comments Jul 8, 2022
@lawrence-forooghian lawrence-forooghian force-pushed the EDX-149-add-canonical-docstring-comments branch from b127e90 to 65b0c33 Compare July 8, 2022 07:36
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 8, 2022 07:38 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 8, 2022 07:39 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the EDX-149-add-canonical-docstring-comments branch 2 times, most recently from a1583fa to 28c3e0d Compare July 11, 2022 21:23
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 11, 2022 21:25 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 11, 2022 21:25 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the EDX-149-add-canonical-docstring-comments branch from 28c3e0d to bff22c5 Compare July 11, 2022 21:28
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 11, 2022 21:29 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 11, 2022 21:29 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/bundle-report July 11, 2022 21:36 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1026/typedoc July 11, 2022 21:37 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the EDX-149-add-canonical-docstring-comments branch from b1c03f5 to f96010a Compare July 12, 2022 21:44
This SDK only supports keys of 128 or 256 bits.
This isn’t part of the canonical descriptions because they describe the
type of this property as “platform specific”.
…argument

I inferred this behaviour by looking at stats() in
src/common/lib/client/rest.ts.
…stBase

In ably-js, the realtime classes inherit from the REST ones, which isn’t
the case in the IDL or canonical docs.
It’s not supported by the JS SDK, it appears.
So that we get the nice formatting that emphasises what the canonical
docstring says.
Copied from the legacy docstring.
Taken (slightly reworded) from the legacy docstring.
I have some stuff I need to fix up here, so want to mark which ones I
need to edit.

Generated by running `./docstrings_helper.rb mark-canonical-with-params`.
(The stuff I marked in c781896.)

I think that the canonical documentation would benefit from using
placeholder param names instead of referring to params by their type,
but that would require a corresponding change to the IDL which I’m not
going to have time to make right now.
Now that the names are now correct after 47f5f52.
Generated by running `./docstrings_helper.rb mark-legacy-matches-canonical`.
(The stuff I marked in 7fc0c55.)

Here, “audited” just means that I read the strings and that they don’t
contradict my knowledge of the ably-JS SDK or my broader understanding
of how our SDKs work. Definitely not a proper proof-read (for style or
content), which is outside the scope of this pull request.
Generated by running `./docstrings_helper.rb mark-canonical-without-legacy`.
(The stuff I marked in 0dfc7cf.)

“Audited“ here has the same meaning as in ecfb3fe.
As in ecfb3fe, “audited” here means that I read the docstrings and
didn’t see any obvious contradictions to my understanding of how ably-js
works or how our SDKs more broadly work. It also means that the
canonical docstrings do not obviously contradict the legacy docstrings.

It does not, however, mean that the canonical docstrings are in any way
“better” than the legacy ones. For example, there are definitely places
where the legacy docstrings are far more detailed than the canonical
ones. But I’ve assumed that to be intentional on the part of the
canonical docstrings, and even if it’s not, addressing that isn’t within
the scope of this work.
I introduced this in c781896 to help me with the process of adding
canonical docstrings en masse. Now that’s done, I don’t need it any
more.
@lawrence-forooghian
Copy link
Collaborator Author

lawrence-forooghian commented Sep 17, 2022

@owenpearson this is now ready for re-review. I've addressed your comments and incorporated the latest version of the canonical docstrings. I've also added some review notes to the PR description.

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.

all LGTM, nice work 👍

@lawrence-forooghian lawrence-forooghian merged commit 9a9e3b9 into integration/docs Sep 28, 2022
@lawrence-forooghian lawrence-forooghian deleted the EDX-149-add-canonical-docstring-comments branch September 28, 2022 11:52
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.

2 participants