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

Add doc details for $Shape. #6694

Closed
wants to merge 1 commit into from
Closed

Add doc details for $Shape. #6694

wants to merge 1 commit into from

Conversation

vicapow
Copy link
Contributor

@vicapow vicapow commented Aug 4, 2018

No description provided.

@@ -578,6 +578,23 @@ function makeParamStore<T>(storeClass: Class<ParamStore<T>>, data: T): ParamStor
(makeParamStore(ParamStore, 1): ParamStore<boolean>); // failed because of the second parameter
```

## `Shape<T>` <a class="toc" id="toc-shape" href="#toc-shape"></a>

Copies the shape of the type supplied, but marks every field optional.

Choose a reason for hiding this comment

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

Maybe not use "Shape" in the definition of "Shape"? How does "Copies an existing type and makes each of its properties optional" sound?

website/en/docs/types/utilities.md Show resolved Hide resolved
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

User is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

wchargin added a commit to wchargin/flow that referenced this pull request Aug 8, 2018
Summary:
Docs for `$Shape` were introduced in facebook#6694, but that PR had three major
errors:

  - the section was not linked from the table of contents
  - the type `$Shape<T>` was misspelled as `Shape<T>` in the header
  - the code block was not terminated, so the entirety of the rest of
    the page was marked as code, [like this][1]—clearly no one previewed
    the page before deploying!

[1]: https://archive.fo/CqH7D#87%

Test Plan:
After much effort, managed to get the website to build locally. Visited
<http://localhost:8080/en/docs/types/utilities/#toc-shape> and checked
that the three issues mentioned above are all fixed.

wchargin-branch: fix-shape-docs
@wchargin wchargin mentioned this pull request Aug 8, 2018
wchargin added a commit to wchargin/flow that referenced this pull request Aug 8, 2018
Summary:
Docs for `$Shape` were introduced in facebook#6694, but that PR had three major
errors:

  - the section was not linked from the table of contents
  - the type `$Shape<T>` was misspelled as `Shape<T>` in the header
  - the code block was not terminated, so the entirety of the rest of
    the page was marked as code, [like this][1]—clearly no one previewed
    the page before deploying!

[1]: https://archive.fo/CqH7D#87%

Closes facebook#6692.

Test Plan:
After much effort, managed to get the website to build locally. Visited
<http://localhost:8080/en/docs/types/utilities/#toc-shape> and checked
that the three issues mentioned above are all fixed.

(For posterity, steps taken to get the build working are listed here:
<facebook#6708 (comment)>.)

wchargin-branch: fix-shape-docs
wchargin added a commit to wchargin/flow that referenced this pull request Aug 8, 2018
Summary:
Docs for `$Shape` were introduced in facebook#6694, but that PR had four major
errors:

  - the section was not linked from the table of contents;
  - the type `$Shape<T>` was misspelled as `Shape<T>` in the header;
  - the code block did not have `// @flow`, so lacked error annotations;
  - the code block was not terminated, so the entirety of the rest of
    the page was marked as code, [like this][1]—clearly no one previewed
    the page before deploying!

[1]: https://archive.fo/CqH7D#87%

This patch fixes those errors. While in the area, we clean up the
comments reading "Error" and "OK" to (a) eliminate the horizontal
scrollbar and (b) match the style elsewhere on the page.

Closes facebook#6692.

Test Plan:
After much effort, managed to get the website to build locally. Visited
<http://localhost:8080/en/docs/types/utilities/#toc-shape> and checked
that the four issues mentioned above are all fixed.

(For posterity, steps taken to get the build working are listed here:
<facebook#6708 (comment)>.)

wchargin-branch: fix-shape-docs
facebook-github-bot pushed a commit that referenced this pull request Aug 10, 2018
Summary:
Docs for `$Shape` were introduced in #6694, but that PR had four major
errors:

  - the section was not linked from the table of contents;
  - the type `$Shape<T>` was misspelled as `Shape<T>` in the header;
  - the code block did not have `// flow`, so lacked error annotations;
  - the code block was not terminated, so the entirety of the rest of
    the page was marked as code, [like this][1]—clearly no one previewed
    the page before deploying!

[1]: https://archive.fo/CqH7D#87%

This patch fixes those errors. While in the area, we clean up the
comments reading "Error" and "OK" to (a) eliminate the horizontal
scrollbar and (b) match the style elsewhere on the page.

Closes #6692.
Pull Request resolved: #6708

Reviewed By: panagosg7

Differential Revision: D9249420

Pulled By: jbrown215

fbshipit-source-id: a54de957c5ac744ce7c483c4be0cbfd182dfee02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants