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:
certAndProjectMap.js
is likely to be deletedcertMap
and projectMap
should be fetched with useStaticQuery when we build the clientCertification.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.
Would we want to do something about utils/block-nameify.js
as it relates to hardcoded names?
certMap
andprojectMap
can be built during the build of the challenge files ingetChallenges.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.
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 superBlock
s while building the curriculum and then fetch them with a GraphQL query in the client. Same reasoning as above.
@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.
@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.
@ojeytonwilliams Yes, I have been meaning to document it anyway.
Most helpful comment
@ojeytonwilliams Yes, I have been meaning to document it anyway.