reduxjs / redux

A JS library for predictable global state management
https://redux.js.org
MIT License
60.87k stars 15.27k forks source link

Tutorials need to show `ReactDOM.createRoot()` to match React 18 #4480

Open markerikson opened 1 year ago

markerikson commented 1 year ago

Both the "Essentials" and "Fundamentals" tutorials are currently showing ReactDOM.render(), and that needs to be update to match React 18.

marktlinn commented 1 year ago

Both the "Essentials" and "Fundamentals" tutorials are currently showing ReactDOM.render(), and that needs to be update to match React 18.

I'm happy to work on this and update the tutorials for React

markerikson commented 1 year ago

@marksist300 unfortunately it's more complicated than just updating a couple of render() calls. The example repos need to be reworked, and that requires actually doing a bunch of Git history surgery to alter the first commits, rebase all the following commits, and update all the tags used by the example sandboxes.

marktlinn commented 1 year ago

@marksist300 unfortunately it's more complicated than just updating a couple of render() calls. The example repos need to be reworked, and that requires actually doing a bunch of Git history surgery to alter the first commits, rebase all the following commits, and update all the tags used by the example sandboxes.

Ah, ok. I thought rebasing public repos was generally a 'no no'?

markerikson commented 1 year ago

Usually! But in this case, it's a template/example repo. The main purpose is to have a known sequence of commits that build the example app step-by-step, and the CodeSandboxes in the tutorial pages link to specific commits by tag so they can show the state of the code as of those commits.

The other use case is that the first commit in the repo has all the dependencies listed and the basic scaffolding, so that learners can clone the repo and follow along with the tutorial by writing each step themselves.

Given that, users don't care about the history of the repo, exactly. There's no ongoing development, no one is going to clone it and try to push feature branches, etc. Also, all the rebasing I'm talking about is solely for the tutorial-steps branch, and I'm the only one who's touched that :)

marktlinn commented 1 year ago

OK. Probably best left to someone who knows exactly what should and shouldn't be included from the git history then 🙂.

I was looking through the Redux fundamentals last night and noticed the docs are using e.which to register keystrokes:

Screenshot 2023-02-24 at 09 19 49

Wasn't sure it would warrant a separate issue, but it should probably be added to the list of code snippets to update as it's deprecated. It's used on several pages.

markerikson commented 2 months ago

I take that back, the "Fundamentals" tutorial repo still needs to be updated.