Custom component friendlyName deprecated for component name

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.

Screenshots or video link

Code stack you are integrating Builder with
NextJS

Sample Code of what we’re trying to achieve

Builder.registerComponent(Img, {
  name: Img,
  friendlyName: 'Image', // <-- any solution for this
  inputs: [
    {
      name: 'image',
      type: 'file',
      allowedFileTypes: ['jpg', 'png'],
      required: true,
    },
  ],
});

Hi @Jason.yang,

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!!" }],
});

1 Like