Skip to content

refactor(react): rename createReactComponent to createComponentImplementation#1024

Open
ppazosp wants to merge 1 commit intogoogle:mainfrom
ppazosp:refactor/rename-createReactComponent
Open

refactor(react): rename createReactComponent to createComponentImplementation#1024
ppazosp wants to merge 1 commit intogoogle:mainfrom
ppazosp:refactor/rename-createReactComponent

Conversation

@ppazosp
Copy link
Copy Markdown

@ppazosp ppazosp commented Mar 29, 2026

Description

Renames createReactComponent to createComponentImplementation across the React v0.9 renderer.

As noted in #974, React developers will only be using this function within the React renderer context, so including "React" in the name is redundant. The new name better describes what the function does: it creates a component implementation from a ComponentApi definition.

Changes:

  • Renamed the function in adapter.tsx (definition + export)
  • Updated all 23 component files (basic + minimal catalogs) that import it
  • Updated tests in adapter.test.tsx
  • Updated CHANGELOG.md reference

All 397 existing tests pass.

Closes #974

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 29, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request renames createReactComponent to createComponentImplementation across the React renderer's adapter, components, and tests. Feedback identifies a violation of the repository's style guide regarding the pre-review checklist and suggests that this breaking change be documented in a new CHANGELOG entry for better visibility. Furthermore, it is recommended to rename createBinderlessComponent to ensure naming consistency across the API.

## 0.8.1

- Use the `InferredComponentApiSchemaType` from `web_core` in `createReactComponent`.
- Use the `InferredComponentApiSchemaType` from `web_core` in `createComponentImplementation`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The 'I have added updates to the [CHANGELOG]' checkbox in the PR description is unchecked, which is confusing as this file is modified. The repository style guide requires the pre-review checklist to be fully completed.

More importantly, renaming an exported function is a breaking change and should be explicitly documented. The current change modifies an existing entry, which may not give enough visibility to this important update.

Please add a new entry, perhaps under an ## Unreleased section, to clearly communicate this breaking change. For example:

## Unreleased

- **BREAKING CHANGE**: Renamed `createReactComponent` to `createComponentImplementation`.
References
  1. PR descriptions should include the Pre-Review Checklist from the PR template, with all of the steps completed. (link)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done — added an Unreleased section with both breaking changes documented. Also renamed createBinderlessComponent to createBinderlessComponentImplementation for consistency as suggested in the other comment.

* Creates a React component implementation using the deep generic binder.
*/
export function createReactComponent<Api extends ComponentApi>(
export function createComponentImplementation<Api extends ComponentApi>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with this rename, consider also renaming createBinderlessComponent (at line 107) to createBinderlessComponentImplementation. Both functions return a ReactComponentImplementation, so it would make their purpose clearer and more parallel if their names followed a similar pattern.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch — done. Renamed createBinderlessComponent to createBinderlessComponentImplementation in the same commit.

@ppazosp ppazosp force-pushed the refactor/rename-createReactComponent branch from 0b8afa6 to 4000538 Compare March 29, 2026 19:02
…entation

Also renames createBinderlessComponent to
createBinderlessComponentImplementation for consistency.

Closes google#974
@ppazosp ppazosp force-pushed the refactor/rename-createReactComponent branch from 4000538 to 27e2642 Compare March 29, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Consider renaming createReactComponent to createComponentImplementation

1 participant