question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discuss Refactoring of API in Client

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
RandellDawsoncommented, Sep 16, 2020

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

1reaction
ojeytonwilliamscommented, Sep 16, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refactoring an entire API Ecosystem
APIs were built based on what the team thought one client would need, but usually ended up being unusable for other clients, so...
Read more >
Refactoring Towards Expressive REST APIs: Let Your Code ...
One of the main advantages of RESTful APIs is discoverability—clients can know what resources are available to them based on hypermedia ...
Read more >
What is Refactoring (Code Refactoring)? - TechTarget
Refactoring is the process of restructuring code, while not changing its original functionality. The goal of refactoring is to improve internal code by ......
Read more >
Refactoring API Code - API - INTERMEDIATE - Skillsoft
In this course, you'll learn about the need for refactoring, best practices, and benefits of refactoring code. You'll then examine technical debt and...
Read more >
6 Tips for Testers to Help an API Refactoring Succeed
A description of permissible values for one specific datatype for a 2010 customer base of twenty scientific organizations on internal networks ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found