kentcdodds / bookshelf
- пятница, 26 июня 2020 г. в 00:22:40
JavaScript
Build a ReactJS App workshop
NOTE: This repository is used for a multi-part workshop
In order for us to maximize our efforts during the workshop, please complete the following things to prepare.
Watch How to get the bookshelf app setup (~18 minutes). Please do NOT skip this step.
useState
, useEffect
, and useRef
.
useContext
, useReducer
, useMemo
, and
useCallback
.
The more prepared you are for the workshop, the better it will go for you.
All of these must be available in your PATH
. To verify things are set up
properly, you can run this:
git --version
node --version
npm --version
If you have trouble with any of these, learn more about the PATH environment variable and how to fix it here for windows or mac/linux.
After you've made sure to have the correct things (and versions) installed, you should be able to just run a few commands to get set up:
git clone https://github.com/kentcdodds/bookshelf.git
cd bookshelf
npm run setup --silent
If you get any errors, please read through them and see if you can find out what the problem is. If you can't work it out on your own then please file an issue and provide all the output from the commands you ran (even if it's a lot).
To get the app up and running (and really see if it worked), run:
npm start
This should start up your browser. If you're familiar, this is a standard react-scripts application.
You can also open the production deployment: bookshelf.lol.
npm test
This will start Jest in watch mode. Read the output and play around with it. The tests are there to help you reach the final version, however sometimes you can accomplish the task and the tests still fail if you implement things differently than I do in my solution, so don't look to them as a complete authority.
To get started, run:
node go
This will allow you to choose which exercise you want to work on. From there,
open the INSTRUCTIONS.md
file and follow the instructions there.
If you'd like to work on an extra credit, but you want to skip the preceding
steps, you can run node go
again:
node go
This will let you choose the next exercise or you can choose which part of the
exercise you'd like to work on. This will update your exercise
files to the
correct version for you to work on that extra credit.
Snuggle up next to the
🔥 with a good📚
This workshop is a bit different from my other workshops. The exercises are much longer and you'll have more time to complete them. We'll also be taking breaks mid-exercise, wherever there's a need. So consider this schedule to be very loose.
Please do ask! Interrupt me. If you have an unrelated question, please ask on my AMA.
The exercises are in different branches. Each branch changes the
INSTRUCTIONS.md
file to contain instructions you need to complete the
exercise.
The purpose of the exercise is not for you to work through all the material. It's intended to get your brain thinking about the right questions to ask me as I walk through the material.
Each exercise has comments in it to help you get through the exercise. These fun emoji characters are here to help you.
INSTRUCTIONS.md
User
List Item
Date.now()
)Date.now()
)For convenience, our friendly backend engineers also return a
book
object on each list item which is the book it's associated to. Thanks backend folks!
/me wishes we could use GraphQL
If your "database" gets out of whack, you can purge it via:
window.__bookshelf.purgeUsers()
window.__bookshelf.purgeListItems()
Book
Each exercise has an Elaboration and Feedback link. Please fill that out after the exercise and instruction.
At the end of the workshop, please go to this URL to give overall feedback. Thank you!
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
This material is available for private, non-commercial use under the GPL version 3. If you would like to use this material to conduct your own workshop, please contact me at me@kentcdodds.com