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

fix: make docs not output confusing information in xrpl client #2337

Merged
merged 59 commits into from
Aug 15, 2023
Merged

Conversation

justinr1234
Copy link
Collaborator

@justinr1234 justinr1234 commented Jun 9, 2023

High Level Overview of Change

Docs are super confusing today. They don't output the correct information due to how functions are assigned to the class. We're also missing docs for several function. Additionally, there's overuse over overloaded functions which get output as separate functions in the docs page making it cluttered and difficult to follow.

TODO

  • add a before and after image of the documentation

Context of Change

  • Refactor class methods to live on the class instead of imported and assigned to member variables
  • Replace function overloads with typescript conditional types
  • Improve jsdoc strings for multiple functions
  • Improve missing test for requestNextPage

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Test Plan

  • CI passes
  • Docs page looks right and works well

Before

image

After (properly marked as member functions and not variable constants)

image

Before (submit bare documentation)

image

After (documentation and examples are shown)

image image

Before (request has a bajillion overloads and is missing an example)

image

After (request is clean and has example)

image

Before (multiple client methods missing examples)

image

After (all client methods have examples)

image

@justinr1234
Copy link
Collaborator Author

Closes #2337

@justinr1234 justinr1234 linked an issue Jun 9, 2023 that may be closed by this pull request
@justinr1234 justinr1234 marked this pull request as ready for review June 13, 2023 23:56
@justinr1234
Copy link
Collaborator Author

I will add a separate PR to generate the docs

@pdp2121
Copy link
Collaborator

pdp2121 commented Jun 20, 2023

Hmm I'm not sure if this is the only way to generate better docs but this solution will make a long index files (most of functions in this file are abstraction, with exception for making a request and connect/disconnect) and also it would be a bit confusing imo to have the fundWallet or autofill files in sugar folder without the fundWallet and autofill function (seems more like utils files for me)

@justinr1234
Copy link
Collaborator Author

Hmm I'm not sure if this is the only way to generate better docs but this solution will make a long index files (most of functions in this file are abstraction, with exception for making a request and connect/disconnect) and also it would be a bit confusing imo to have the fundWallet or autofill files in sugar folder without the fundWallet and autofill function (seems more like utils files for me)

I’m fairly sure this is the only way, but open to another solution if you have one.

Aside from that, I tried to balance making it smaller by refactoring certain internal details to a separate file.

@pdp2121 pdp2121 self-requested a review June 26, 2023 16:41
@pdp2121
Copy link
Collaborator

pdp2121 commented Jun 26, 2023

Hmm I'm not sure if this is the only way to generate better docs but this solution will make a long index files (most of functions in this file are abstraction, with exception for making a request and connect/disconnect) and also it would be a bit confusing imo to have the fundWallet or autofill files in sugar folder without the fundWallet and autofill function (seems more like utils files for me)

I’m fairly sure this is the only way, but open to another solution if you have one.

Aside from that, I tried to balance making it smaller by refactoring certain internal details to a separate file.

I'm not familiar with docs generation so if that's the only way to output desired output, please go ahead with it.

@ckniffen
Copy link
Collaborator

Can you add a before and after image of the documentation?

@socket-security
Copy link

socket-security bot commented Jul 13, 2023

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
run-s 0.0.0 None +0 491 B mysticatea

@JST5000
Copy link
Contributor

JST5000 commented Aug 9, 2023

Notes on what I did during the merge to resolve the trickier conflicts:

  1. I replaced the fundWallet function that was moved to the Client with the updated version from previous 3.0 changes to remove the HTTP polyfill.
  2. I removed a couple lodash imports which spawned from the merge (both from flatMap so switched to the es2019 syntax of .flatMap instead)
  3. I made sure to double check that the removed imports in the package.json from other 3.0 changes stayed out

@JST5000 JST5000 dismissed their stale review August 9, 2023 01:11

I've become a contributor, so can't review myself

Copy link
Collaborator

Choose a reason for hiding this comment

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

What caused this to remove many entries? The only dependency change was "run-s": "^0.0.0", which I would think might add entries and not remove.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I may have chosen the wrong version to merge then - there was a package-lock conflict and I assumed the 3.0 version would be shorter.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why it still changed - but I used the 3.0 version and ran npm i - does that new result look sensible, or is there something I accidentally changed?

Copy link
Collaborator

@ckniffen ckniffen Aug 9, 2023

Choose a reason for hiding this comment

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

Try copying the 3.0 version of the file and run npm i again and see what happens

Copy link
Contributor

Choose a reason for hiding this comment

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

@ckniffen Just did that again, and this was still the result. I think it's the correct updates now as it's mostly updating things to 'dev' dependencies or updating the 'integrity' line, which seems minor. (Along with adding run-s)

@ckniffen ckniffen added the 3.0 label Aug 14, 2023
@JST5000 JST5000 merged commit ebe1330 into 3.0 Aug 15, 2023
11 checks passed
@JST5000 JST5000 deleted the docs-fixes branch August 15, 2023 00:11
ckniffen added a commit that referenced this pull request Aug 15, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Aug 28, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Aug 28, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Sep 1, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Oct 5, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Oct 18, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Oct 25, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Nov 1, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Nov 30, 2023
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
ckniffen added a commit that referenced this pull request Feb 1, 2024
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix missing descriptions in docs
6 participants