Skip to content

refactor: blockType -> blockLabel#62548

Merged
raisedadead merged 11 commits intofreeCodeCamp:mainfrom
ojeytonwilliams:refactor/blocktype-to-blocklabel
Oct 23, 2025
Merged

refactor: blockType -> blockLabel#62548
raisedadead merged 11 commits intofreeCodeCamp:mainfrom
ojeytonwilliams:refactor/blocktype-to-blocklabel

Conversation

@ojeytonwilliams
Copy link
Copy Markdown
Contributor

Checklist:

The name blockType suggests that it should be used to differentiate between different kinds of blocks. This is quite vague and it already has a specific use: selecting which label to render. Calling it blockLabel makes it's role clear and should make further abuse less likely.

The one case where it was meaningful (when determining if a donation modal should appear) I used challengeType instead. challengeType is already used to differentiate between different kinds of challenges, so this is a least consistent with how it is already used. One idea we've discussed is splitting challengeType into more focused, more descriptive elements. I opted not to do that here to keep the change as simple as possible.

@freeCodeCamp/mobile I've changed the external curriculum. What do we need to change to handle that?

@ojeytonwilliams ojeytonwilliams requested review from a team October 6, 2025 08:14
@github-actions github-actions bot added platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. labels Oct 6, 2025
@huyenltnguyen
Copy link
Copy Markdown
Member

For mobile, I think the easiest change would be:


This is technically a breaking change, so do we want to... um... bump the external data version?

@huyenltnguyen
Copy link
Copy Markdown
Member

Well actually, I wonder if we should keep blockType for mobile for now. In the external curricula scripts, we'll just pass blockLabel as blockType instead of renaming the field.

We'll need to bump the script version at some point, once FSD is replaced with the checkpoint certs and the English super blocks are converted to the chapter structure.

@ojeytonwilliams ojeytonwilliams added the status: blocked In a transient & temporary hold. label Oct 6, 2025
@ojeytonwilliams
Copy link
Copy Markdown
Contributor Author

Both strategies seem fine to me, so I'd go with whichever seems like less hassle. Presumably rolling this change into the v3 you had planned?

I'll leave this blocked until we've got a clear path forward.

@huyenltnguyen
Copy link
Copy Markdown
Member

Yeah, I'd vote to keep blockType in the external curricula data and defer this change to v3, so we don't need to change the mobile code yet.

@ojeytonwilliams ojeytonwilliams added status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. and removed status: blocked In a transient & temporary hold. labels Oct 7, 2025
@ojeytonwilliams
Copy link
Copy Markdown
Contributor Author

I think this should work. It's compliant with the schema, at least.

@ojeytonwilliams ojeytonwilliams force-pushed the refactor/blocktype-to-blocklabel branch from 30cd228 to e47b78d Compare October 7, 2025 10:13
@camper-chan camper-chan bot added the MERGE CONFLICT! To be applied to PR's that have a merge conflict and need updating label Oct 9, 2025
@huyenltnguyen huyenltnguyen self-assigned this Oct 10, 2025
@jdwilkin4 jdwilkin4 removed the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Oct 14, 2025
@huyenltnguyen huyenltnguyen removed their assignment Oct 21, 2025
ojeytonwilliams and others added 8 commits October 22, 2025 14:54
challengeType is already used to distinguish between different challenges. In contrast, blockType is (now) only used to select the block's label
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
@ojeytonwilliams ojeytonwilliams force-pushed the refactor/blocktype-to-blocklabel branch from a55b486 to b68d44d Compare October 22, 2025 13:02
@ojeytonwilliams ojeytonwilliams added status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. and removed MERGE CONFLICT! To be applied to PR's that have a merge conflict and need updating labels Oct 22, 2025
@huyenltnguyen
Copy link
Copy Markdown
Member

We've got a type check error apparently.

@huyenltnguyen huyenltnguyen added status: waiting update Is awaiting update, after feedback or request for changes and removed status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. labels Oct 22, 2025
@majestic-owl448 majestic-owl448 added the MERGE CONFLICT! To be applied to PR's that have a merge conflict and need updating label Oct 23, 2025
@raisedadead raisedadead enabled auto-merge (squash) October 23, 2025 10:01
@raisedadead raisedadead removed the MERGE CONFLICT! To be applied to PR's that have a merge conflict and need updating label Oct 23, 2025
@huyenltnguyen huyenltnguyen added status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. and removed status: waiting update Is awaiting update, after feedback or request for changes labels Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants