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

New Top Level Menu Item Tutorial, Tutorial ported from @spicyj's Internal Course #7875

Merged
merged 17 commits into from
Oct 7, 2016
Merged

Conversation

ericnakagawa
Copy link
Contributor

  • added top level 'Tutorial' section
  • added a 2 images to help illustrate tutorial
  • ran through the tutorial and made small edits for clarity

@vjeux
Copy link
Contributor

vjeux commented Oct 4, 2016

Do you mind taking a screenshot of the entire page and displaying it here?

@sophiebits
Copy link
Collaborator

Last time I went through this, it felt like the "Storing a History" section was too much typing and moving code around. I was thinking that it might be better to simple have a bullet list

* Move #1
* Move #2
* Move #3

so that we don't need the whole new {squares, xIsNext, move, when} object and just have an array of squares instead. Not sure if that's best though, open to better ideas. You can watch the internal video at this part and I think you'll agree that it dragged on.

@sophiebits
Copy link
Collaborator

We need a couple paragraphs explaining the value of immutable data, more than the brief snippet I currently have. I got like 5 separate questions on it.

@ericnakagawa
Copy link
Contributor Author

screencapture-localhost-4000-react-tutorial-tutorial-html-1475620696450

Full page capture.

@lacker
Copy link
Contributor

lacker commented Oct 4, 2016

Nit: All of the nav links have a little "linking to an external site" thingy on them.

@gaearon
Copy link
Collaborator

gaearon commented Oct 4, 2016

Do we want to start method names with underscores? We don't do this anywhere else in the docs, and it doesn't seem to be popular in the community either.

href: https://github.com/facebook/react/wiki/Examples
- title: Guides
items:
- id: why-react
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the reason for adding these back in? I intentionally removed them from docs and left them in docs-old so that we tell new and old content apart and gradually migrate it.

Copy link
Contributor

@vjeux vjeux Oct 4, 2016

Choose a reason for hiding this comment

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

Looking at the history of the commits, it looks like a bad merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gaearon Bad merge, had to back out of it. This PR should reapply the changes you made.

@ericnakagawa
Copy link
Contributor Author

@spicyj Added a light section on immutability.

@ericnakagawa
Copy link
Contributor Author

@gaearon Removed underscores.

@gaearon
Copy link
Collaborator

gaearon commented Oct 5, 2016

Let's get it in and address any nits later? It's getting hard to review with this PR size.

@ericnakagawa
Copy link
Contributor Author

@spicyj I simplified Save History to only track squares, xIsNext converted into a function.

@ericnakagawa
Copy link
Contributor Author

@lacker Removed external link classes on sidebar by checking for presence of variable in dev_tutorial.yml

@ericnakagawa
Copy link
Contributor Author

Updated full page capture:

screencapture-localhost-4000-react-tutorial-tutorial-html-1475713523946

@sophiebits
Copy link
Collaborator

You mixed up moveNext and moveNumber. Do we need either though? Maybe we can use the index. Though that isn't great for convincing people to key things accurately.

@ericnakagawa
Copy link
Contributor Author

@spicyj Resolved variable mixup in docs. Kept moveNumber, removed moveNext. Also removed helper function and calculate next player based on move number when user clicks on history.

@sophiebits
Copy link
Collaborator

I meant: can't you infer the move number from the index in array? I'm trying to avoid the {squares, moveNumber} object completely.

@lacker
Copy link
Contributor

lacker commented Oct 6, 2016

Let's put the "Tutorial" tab second, right after "Docs", just to nudge it up in prominence a bit.

@ericnakagawa
Copy link
Contributor Author

@spicyj Removed moveNumber and now using index.

@lacker Moved Tutorial to #2 position on top nav bar.

@ericnakagawa ericnakagawa merged commit 7f03db5 into facebook:new-docs Oct 7, 2016
#### Data change without mutation
```javascript
var player = {score: 1}
player = {...player, score: 2} // new object not mutated {score: 2}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not part of ES6. We should make it clear this syntax is a stage 3 proposal, and show an ES6 alternative.
It might also be confusing why we spread over an object with just one property which we are updating.

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.

7 participants