Add Provable to documentation #1972
Draft
+250
−4
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.
Summary
Provable and Provable are both exported as
Provable
from the same file. There are good documentation comments on the constant variableProvable
that we want to expose in the o1js-reference documentation, but it is tricky to disambiguate the two symbols.Approach
This PR creates a dummy type called
ProvableNamespace
and exports it such that documentation about the type generates undertype-aliases/ProvableNamespace
. This isn't ideal, but it does quickly and without fuss get the documentation out there.Alternatives considered
Modifying the export
We can abandon our style of declaring module exports at the top of the file, but the result is that many of the comments are missing in the ultimate documentation. For instance, this documentation is what we get for
witness
:And this is the documentation we get using the fake type workaround:
The second version is what we want to show to developers.
Changing the name of one or the other
Provable
This approach seems like the best long-term solution, but involves fixing a lot of imports across the code-base and a potential for regression that my lightweight approach does not risk. I'd like to take this approach eventually, but first learn more about this code, why the names were chosen the way they were, and which footguns to look out for in extricating them.