-
Notifications
You must be signed in to change notification settings - Fork 47.9k
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
Conversation
ericnakagawa
commented
Oct 4, 2016
- added top level 'Tutorial' section
- added a 2 images to help illustrate tutorial
- ran through the tutorial and made small edits for clarity
Do you mind taking a screenshot of the entire page and displaying it here? |
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
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. |
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. |
Nit: All of the nav links have a little "linking to an external site" thingy on them. |
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@spicyj Added a light section on immutability. |
@gaearon Removed underscores. |
Let's get it in and address any nits later? It's getting hard to review with this PR size. |
@spicyj I simplified Save History to only track squares, xIsNext converted into a function. |
@lacker Removed external link classes on sidebar by checking for presence of variable in dev_tutorial.yml |
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. |
@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. |
I meant: can't you infer the move number from the index in array? I'm trying to avoid the {squares, moveNumber} object completely. |
Let's put the "Tutorial" tab second, right after "Docs", just to nudge it up in prominence a bit. |
#### Data change without mutation | ||
```javascript | ||
var player = {score: 1} | ||
player = {...player, score: 2} // new object not mutated {score: 2} |
There was a problem hiding this comment.
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.