Skip to content

Discuss Refactoring of API in Client #39590

Closed

Description

@ShaunSHamilton

This comes about as I was going to refactor Certification.js to not rely on hardcoded values, but after discussing with Mrugesh and Oliver, realise it is not a quick section to fix.

Top sections to refactor:

  • ./redux Move from using both epics and sagas to just sagas.

What I have been looking into:

  • Certification.js (certMapSelector, and renderLegacyFullStack)
  • ShowCertification.js (imports certMap)
  • certAndProjectMap.js (Kris left a comment about refactoring to automatically generate from md/.json files)
  • getChallenges.js (Oliver mentioned splitting this up into more bite-sized functions to allow better access outwith)

Minutes:

  • Rather than moving away from Redux, it would be beneficial to leverage it without complex epics
  • Use Redux hooks, for refactor of functional components

  • certAndProjectMap.js is likely to be deleted
  • certMap and projectMap should be fetched with useStaticQuery when we build the client
  • Certification.js and ShowCertification.js could make use of a graphQL query to fetch the certMap

Feel free to edit this. @ojeytonwilliams and @raisedadead feel free to correct/add anything I missed.

Activity

  1. added
    status: discussing
    platform: api
    status: waiting triage
    scope: tools/scripts
    on Sep 16, 2020
  2. RandellDawson commented on Sep 16, 2020

    @RandellDawson
    Member

    Would we want to do something about utils/block-nameify.js as it relates to hardcoded names?

  3. ojeytonwilliams commented on Sep 16, 2020

    @ojeytonwilliams
    Contributor

    certMap and projectMap can be built during the build of the challenge files in getChallenges.js

    That was just a bad idea of mine. Mrugesh was right: if we can, we should just make use of useStaticQuery to fetch the data we need when we build the client. That creates a better separation of the client and the curriculum.

  4. ojeytonwilliams commented on Sep 16, 2020

    @ojeytonwilliams
    Contributor

    Would we want to do something about utils/block-nameify.js as it relates to hardcoded names?

    Not necessarily, since the names have to appear somewhere. That said, it's possible the best approach is to just apply blockNameify to set the superBlocks while building the curriculum and then fetch them with a GraphQL query in the client. Same reasoning as above.

  5. RandellDawson commented on Sep 16, 2020

    @RandellDawson
    Member

    @ojeytonwilliams Ultimately, I just want the process of adding a new block (project in v7) easier. Currently, this involves updating multiple files in various files located in the client and curriculum folders. There is a lot of duplicate information in those various files.

  6. ojeytonwilliams commented on Sep 16, 2020

    @ojeytonwilliams
    Contributor

    @RandellDawson since you're doing this a lot, would you mind noting all the places you have to change things? Not necessarily right now, but it would be great if you could keep this in mind next time you add a block.

  7. RandellDawson commented on Sep 16, 2020

    @RandellDawson
    Member

    @ojeytonwilliams Yes, I have been meaning to document it anyway.

  8. removed
    status: waiting triage
    on Apr 29, 2021
  9. moT01 commented on Aug 3, 2021

    @moT01
    Member

    Thank you for reporting this issue.

    This is a standard message notifying you that the issue has become stale, so we are going to close it.

    If you think we're wrong in closing this issue, please request for it to be reopened. Thank you and happy coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: apiscope: tools/scriptsstatus: discussing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions