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

DAH-1360: Upgrade Partners to React 18 #584

Merged
merged 20 commits into from Dec 20, 2023
Merged

Conversation

chadbrokaw
Copy link
Collaborator

@chadbrokaw chadbrokaw commented Dec 5, 2023

DAH-1360

This PR touches virtually everything in the application. There is nothing specific to test except ensuring that everything looks okay and that the communication between the front and back end is working as expected. A few things this PR does:

  • Upgrades the app from React 16 to 18
  • Removes Enzyme based tests and replaces them with RTL
  • Removes webpacker and replaces it with shakapacker
  • Upgrades react-router-dom to version 6

@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 5, 2023 20:40 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 5, 2023 22:48 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 6, 2023 18:48 Inactive
@chadbrokaw-exygy chadbrokaw-exygy temporarily deployed to dahlia-partners-pr-584 December 12, 2023 16:37 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 12, 2023 16:46 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 12, 2023 16:54 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 12, 2023 17:12 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 12, 2023 20:28 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 12, 2023 23:17 Inactive
@chadbrokaw chadbrokaw changed the title Dah 1360 react 18 upgrade DAH-1360: Upgrade Partners to React 18 Dec 12, 2023
@chadbrokaw chadbrokaw marked this pull request as ready for review December 12, 2023 23:42
"jest.disabledWorkspaceFolders": ["spec/javascript/e2e"],
"editor.codeActionsOnSave": {
// For ESLint
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: comments are not officially supported in JSON, and this comment seems unnecessary.

@@ -100,11 +100,11 @@ gem "slim-rails", "~> 3.1"
# Added at 2017-10-25 00:30:33 -0700 by dkaplan:
gem "hashie"

# Added at 2017-10-29 23:29:10 -0700 by dkaplan:
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: are these comments even necessary? We have git to record this information

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, they seem like clutter to me... I'm good to remove them

const prefName = selectedPreference.lottery_preference.name
form.change(`preferences[${i}].recordtype_developername`, recordTypeMap[prefName] || 'Custom')
}
React.useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: I've noticed that we use custom versions of useEffect and useState hooks, which are defined in customHooks.js. We might want to revisit this later to determine if we actually need the custom versions. Maybe at the time they were implemented, React hooks were not mature enough to meet our needs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. There are likely some of those that are not needed. I created a ticket to investigate this further: https://sfgovdt.jira.com/browse/DAH-1943


React.useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

chore: can you include a section on how to if google analytics is working, in the Review Instructions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure! I added a section for how to test as well as an image that proves that the system is correctly talking with GA

})

test('should render the checkbox with indeterminate=true', () => {
expect(wrapper.find(Checkbox).props().indeterminate).toBeTruthy()
// Even though the checkbox is in the indeterminate state, it is still considered checked
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: make the assertion cleaner with toBePartiallyChecked

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool! Love that

@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 19, 2023 21:53 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-584 December 20, 2023 16:31 Inactive
@hshaosf hshaosf temporarily deployed to dahlia-partners-pr-588 December 20, 2023 18:24 Inactive
Copy link
Contributor

@jimlin-sfgov jimlin-sfgov left a comment

Choose a reason for hiding this comment

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

Looks good, great job finding and updating all the test code to make the update possible!

@chadbrokaw chadbrokaw merged commit 42444d6 into main Dec 20, 2023
8 checks passed
tallulahkay pushed a commit that referenced this pull request Feb 28, 2024
* fix: app works, working through tests

* More tests

* Atom tests

* next wave of tests

* more tests

* add mini-css-extract

* Fix rspec tests

* Add more time to failing test

* fix dep

* fix dep

* fix webpack

* postcss-preset-env

* clean up testing

* Fix test snapshot

* cleanup

* JL PR Feedback

* e2e issues
@jimlin-sfgov jimlin-sfgov deleted the DAH-1360_React_18_upgrade branch April 3, 2024 17:18
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.

None yet

4 participants