Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Rename Legacy Template block to Classic Template block #5861

Closed
Aljullu opened this issue Feb 16, 2022 · 3 comments · Fixed by #6021
Closed

Rename Legacy Template block to Classic Template block #5861

Aljullu opened this issue Feb 16, 2022 · 3 comments · Fixed by #6021
Assignees
Labels
focus: template Related to API powering block template functionality in the Site Editor type: good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team.

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Feb 16, 2022

Suggested by @nerrad, we want to rename the Legacy Template block to Classic Template block.

Some relevant files:

https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/assets/js/blocks/legacy-template/index.tsx

https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/src/BlockTypes/LegacyTemplate.php

@Aljullu Aljullu added type: bug The issue/PR concerns a confirmed bug. type: good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. focus: template Related to API powering block template functionality in the Site Editor and removed type: bug The issue/PR concerns a confirmed bug. labels Feb 16, 2022
@sunyatasattva sunyatasattva self-assigned this Feb 23, 2022
@sunyatasattva
Copy link
Contributor

@Aljullu @nerrad When we do these kinds of renaming, how deep do we want to go renaming things internally? Like, do we change ids? Do we change filenames and classes?

It seems to be it could be weird to have LegacyTemplate.php which defines LegacyTemplate class which is actually called “classic template“ in the end. It could lead to confusion for future devs looking for things.

On the other hand, this kind of deep renaming has of course deeper implication in changing all dependencies and references.

With #5935 (still in draft) I'm sort of going a middle ground approach: renaming user-facing strings and changing some other definitions appearing in test cases descriptions, for example, but I'm leaving slugs, and internal ids as they are.

What are your thoughts?

@Aljullu
Copy link
Contributor Author

Aljullu commented Feb 25, 2022

When we do these kinds of renaming, how deep do we want to go renaming things internally? Like, do we change ids? Do we change filenames and classes?

Good question. I don't have a strong opinion on this. In my opinion, we should go as deep as possible without breaking backwards compatibility. So I guess we can't change ids or anything like that, but I completely agree with your statement here:

It seems to be it could be weird to have LegacyTemplate.php which defines LegacyTemplate class which is actually called “classic template“ in the end. It could lead to confusion for future devs looking for things.

So my question is: can we rename the PHP class while keeping the original block id so template don't invalidate? If so, I would try to go that way?

@tjcafferkey
Copy link
Contributor

I agree with @Aljullu's thoughts on this too. Let's try change what we can which won't negatively impact on our users experience including filenames and asset names etc. IDs and such should remain the same if changing them could cause issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: template Related to API powering block template functionality in the Site Editor type: good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants