What are you trying to accomplish
We want to be able to use friendlyName to rename components so that we don’t have to rebuild all the existing content on production. There is an internal initiative to use consistent component naming across teams and this requires us to rename some components already existing on production.
Since friendlyName is deprecated, it can’t be used anymore, but there is a workaround that you can use possibly so that you don’t have to rebuild all existing components.
You can register the existing component with a friendly name for insertMenu. Below is an example
Builder.registerComponent(MyCustomComponent, {
name: "ExampleCustomComponent",
friendlyName: "SOME GOOD NAME",
inputs: [
{ name: "title", type: "string", defaultValue: "I am a React component!" },
{
name: "description",
type: "string",
defaultValue: "Find my source in /pages/[...page].js",
},
],
});
Builder.register("insertMenu", {
name: "UPDATED COMPONENTS",
items: [{ item: "ExampleCustomComponent", name: "THIS IS REALLY NEW!!" }],
});
@manish-sharma This shows “THIS IS REALLY NEW!!” in the insert menu, but “ExampleCustomComponent” is still shown as the layer name. Is there any way to fully implement the friendlyName functionality so that only the `“THIS IS REALLY NEW!!” is seen from the editor?
We found the friendlyName really convenient and useful for us, so if there’s any way to bring it back or something that allows us to register a component as one thing and show it in the editor as something else, that would be amazing.
Hi team, just wanted to come back here and revisit this topic to let everyone know that friendlyName has actually been un-deprecated, and should now work as expected again! Please check it out and let us know if you have any issues!