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

Migrate to Redux Toolkit part 9 #2989

Merged
merged 17 commits into from
May 6, 2024
Merged

Migrate to Redux Toolkit part 9 #2989

merged 17 commits into from
May 6, 2024

Conversation

RichDom2185
Copy link
Member

@RichDom2185 RichDom2185 commented May 5, 2024

Description

To rebase and merge onto master once #2988 is merged.

Mainly a PR to clean up things, but also migrated to RTK for Sourcecast and Sourcereel reducers.

Removes the compatibility layer of having named exports for every action creator. This forces callers to use the default export (and also fully qualified names) of the actions they want to dispatch. Hopefully, this will reduce the chances of any name conflicts, and also enforce better abstractions and grouping of the individual actions. Currently, I feel that some action creators don't belong in the correct file. By forcing the usage of the fully qualified name (especially as the number of actions keeps increasing), people might think twice before putting an action creator inside a specific file.

Technically a breaking change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

I just changed the imports, without any implementation change (except for the migration of GitHubPersistenceSaga to use the new helper) – so it should be a non-issue.

Checklist

  • I have tested this code
  • I have updated the documentation

@RichDom2185 RichDom2185 self-assigned this May 5, 2024
@RichDom2185 RichDom2185 changed the base branch from master to rtk-8 May 5, 2024 09:04
@RichDom2185 RichDom2185 requested a review from chownces May 5, 2024 10:31
@RichDom2185 RichDom2185 added the blocked Something else needs pass review first label May 5, 2024
Base automatically changed from rtk-8 to master May 5, 2024 17:35
@RichDom2185 RichDom2185 removed the blocked Something else needs pass review first label May 5, 2024
Copy link
Member Author

Choose a reason for hiding this comment

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

@sayomaki @chownces Just wanted to check if you're agreeable to removing the named exports to favour the default exports (and fully qualified names).

@coveralls
Copy link

coveralls commented May 5, 2024

Pull Request Test Coverage Report for Build 8971775169

Details

  • 59 of 152 (38.82%) changed or added relevant lines in 35 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.03%) to 32.11%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/application/Application.tsx 0 1 0.0%
src/commons/application/reducers/CommonsReducer.ts 2 3 66.67%
src/commons/editingWorkspace/EditingWorkspace.tsx 0 1 0.0%
src/commons/notificationBadge/NotificationBadge.tsx 0 1 0.0%
src/commons/profile/Profile.tsx 1 2 50.0%
src/commons/utils/CToWasmHelper.ts 0 1 0.0%
src/commons/utils/SourcerorHelper.ts 0 1 0.0%
src/features/sourceRecorder/sourcecast/SourcecastReducer.ts 17 18 94.44%
src/features/sourceRecorder/sourcereel/SourcereelReducer.ts 19 20 95.0%
src/pages/academy/grading/Grading.tsx 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/pages/sourcecast/Sourcecast.tsx 1 0.0%
src/pages/academy/sourcereel/Sourcereel.tsx 1 0.0%
src/pages/academy/adminPanel/subcomponents/NotificationConfigPanel.tsx 1 0.0%
Totals Coverage Status
Change from base Build 8971758895: -0.03%
Covered Lines: 5011
Relevant Lines: 14652

💛 - Coveralls

Copy link
Contributor

@chownces chownces left a comment

Choose a reason for hiding this comment

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

SessionActions seems quite large and cross-cutting. Perhaps we can consider splitting it up into multiple actions with well-defined names. But that can be done in another PR too. We can add an issue to track it in the meantime

@RichDom2185 RichDom2185 mentioned this pull request May 6, 2024
@RichDom2185
Copy link
Member Author

We can add an issue to track it in the meantime

Done in #2992.

This is to ease the migration in future PRs where the named exports for
action creators are removed.
Removes all direct external references of the action creators, replacing
their direct references with fully qualified names from the default
export.
@RichDom2185 RichDom2185 marked this pull request as ready for review May 6, 2024 15:34
Copy link
Member Author

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

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

Went through the changes one more time and looks good, thanks!

@RichDom2185 RichDom2185 merged commit 2d108b9 into master May 6, 2024
8 checks passed
@RichDom2185 RichDom2185 deleted the rtk-9 branch May 6, 2024 15:46
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.

3 participants