Skip to content

Conversation

aarondemelo
Copy link
Contributor

Added ability to render custom components by registering based on name. Also added calls to register custom components when the app is launched in appetize builder frontend.
Check example https://github.com/aarondemelo/BuilderIOExample as an example to register new components

@aarondemelo aarondemelo requested a review from a team as a code owner July 6, 2025 17:27
@aarondemelo aarondemelo marked this pull request as draft July 6, 2025 17:27

var blocks: [BuilderBlockModel]
var componentType: BuilderComponentType = .box
static let componentType: BuilderComponentType = .box
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have these been made static?

Copy link
Contributor Author

@aarondemelo aarondemelo Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static to make it visible externally during registration without the need to repeat the type instantiation.
eg. for the internal component registration workflow

  • register(type: BuilderImage.componentType, viewClass: BuilderImage.self)

It enables easier custom component registration

  • BuilderComponentRegistry.shared.registerCustomComponent(
    componentView: RatingsComponent.self, apiKey: "###############")

which internally performs registry[componentView.componentType] = componentView

@aarondemelo aarondemelo marked this pull request as ready for review July 7, 2025 11:30
@sanyamkamat sanyamkamat merged commit edd4abf into BuilderIO:main Jul 9, 2025
2 checks passed
@aarondemelo aarondemelo deleted the feat/custom_component branch July 11, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants