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 React Redux to Examples #2198

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

flashdesignory
Copy link
Collaborator

@flashdesignory flashdesignory commented Sep 19, 2023

This version has been lifted from Speedometer and follows the WebKit styles guide.

For more context regarding this update, please view #2199.

@kara

Copy link
Collaborator

@FadySamirSadek FadySamirSadek left a comment

Choose a reason for hiding this comment

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

Thank you so much @flashdesignory for the amazing work, I'm super excited to merge it alongside other Speedometer examples. I've left a few comments on certain aspects and am curious about your perspective on them. While I believe some of my suggestions could enhance our work, I recognize that they might not align with our immediate objective of updating the examples. Please view my comments as open-ended suggestions for discussion rather than definitive change requests.

examples/react-redux/README.md Outdated Show resolved Hide resolved
examples/react-redux/README.md Outdated Show resolved Hide resolved
examples/react-redux/README.md Outdated Show resolved Hide resolved
examples/react-redux/README.md Outdated Show resolved Hide resolved
"dependencies": {
"classnames": "^2.2.5",
"prop-types": "^15.8.1",
"react": "^16.14.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are updating the examples shouldn't we be using the latest react version v18?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When we updated the Speedometer specific versions, we looked at httpArchive and NPM stats to determine, which versions are most widely used on the web today. These queries were done around March '23, so they are slightly outdated now.

"prop-types": "^15.8.1",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-redux": "^7.2.6",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for react-redux, the latest version is 8.1.2 as of the time of this review

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same as comment above, 7.2.6 was the most popular version at the time we chose what version to upgrade to.


import { SHOW_ALL, SHOW_COMPLETED, SHOW_ACTIVE } from "../constants/todo-filters";

export default class Footer extends Component {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the more recent function components are more used and are recommended over class components by the react core team shouldn't we be using them instead of class components? I am aware that this is a big change so it might make more sense to just merge this now and update it later on.
Would love to know your opinion regarding this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For this build, we chose a traditional class pattern to implement the todoMVC application. It's still used widely and I believe it still represents a pattern that is useful to the community.

There will be a React specific version that will use functional components and hooks to represent a more modern approach.

@@ -0,0 +1,43 @@
const path = require("path");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have a strong opinion regarding this but since this is a very simple app shouldn't we use something like parcel to avoid config files and make the example more simpler

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could, this was just what we used for Speedometer. The bundler was less of a focus point for that project.
Since it works, I think this is not a show stopper, maybe a follow up task to update?

examples/react-redux/public/index.html Outdated Show resolved Hide resolved
This was referenced Sep 20, 2023
@flashdesignory
Copy link
Collaborator Author

While I believe some of my suggestions could enhance our work, I recognize that they might not align with our immediate objective of updating the examples.

Hi @FadySamirSadek - thank you for your review 🙏

For Speedometer, we made some decisions in regards to what version to upgrade to and what type of pattern to use to implement the todoMVC application. The big callout here is that we created two React versions.

  1. React Redux, which uses the most commonly used React and React-Redux version in combination with class components.
  2. React only, with functional components and hooks with a more recent React version (pr to come)

There could be an argument made to use React Toolkit vs React Redux, but that could be an additional community contribution that might be interesting to see.

There are multiple ways a React + Redux todoMVC app could be created. This is just one version that we chose that worked for our purpose.

Copy link
Collaborator

@FadySamirSadek FadySamirSadek left a comment

Choose a reason for hiding this comment

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

LGTM

If @addyosmani and @kara green light this we can go ahead and merge it

@flashdesignory flashdesignory merged commit 26c5ed9 into tastejs:master Sep 20, 2023
@flashdesignory flashdesignory deleted the examples-react-redux branch September 20, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants