Skip to content

Commit 27e2642

Browse files
committed
refactor(react): rename createReactComponent to createComponentImplementation
Also renames createBinderlessComponent to createBinderlessComponentImplementation for consistency. Closes #974
1 parent 92b4c2d commit 27e2642

File tree

26 files changed

+60
-55
lines changed

26 files changed

+60
-55
lines changed

renderers/react/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
## Unreleased
2+
3+
- **BREAKING CHANGE**: Renamed `createReactComponent` to `createComponentImplementation`.
4+
- **BREAKING CHANGE**: Renamed `createBinderlessComponent` to `createBinderlessComponentImplementation`.
5+
16
## 0.8.1
27

3-
- Use the `InferredComponentApiSchemaType` from `web_core` in `createReactComponent`.
8+
- Use the `InferredComponentApiSchemaType` from `web_core` in `createComponentImplementation`.
49
- Adjust internal type in `Tabs` widget.
510

611
## 0.8.0

renderers/react/src/v0_9/adapter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export type ReactA2uiComponentProps<T> = {
4141
/**
4242
* Creates a React component implementation using the deep generic binder.
4343
*/
44-
export function createReactComponent<Api extends ComponentApi>(
44+
export function createComponentImplementation<Api extends ComponentApi>(
4545
api: Api,
4646
RenderComponent: React.FC<
4747
ReactA2uiComponentProps<ResolveA2uiProps<InferredComponentApiSchemaType<Api>>>
@@ -104,7 +104,7 @@ export function createReactComponent<Api extends ComponentApi>(
104104
/**
105105
* Creates a React component implementation that manages its own context bindings (no generic binder).
106106
*/
107-
export function createBinderlessComponent(
107+
export function createBinderlessComponentImplementation(
108108
api: ComponentApi,
109109
RenderComponent: React.FC<{
110110
context: ComponentContext;

renderers/react/src/v0_9/catalog/basic/components/AudioPlayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
import React from 'react';
18-
import {createReactComponent} from '../../../adapter';
18+
import {createComponentImplementation} from '../../../adapter';
1919
import {AudioPlayerApi} from '@a2ui/web_core/v0_9/basic_catalog';
2020
import {getBaseLeafStyle} from '../utils';
2121

22-
export const AudioPlayer = createReactComponent(AudioPlayerApi, ({props}) => {
22+
export const AudioPlayer = createComponentImplementation(AudioPlayerApi, ({props}) => {
2323
const style: React.CSSProperties = {
2424
...getBaseLeafStyle(),
2525
width: '100%',

renderers/react/src/v0_9/catalog/basic/components/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
import React from 'react';
18-
import {createReactComponent} from '../../../adapter';
18+
import {createComponentImplementation} from '../../../adapter';
1919
import {ButtonApi} from '@a2ui/web_core/v0_9/basic_catalog';
2020
import {LEAF_MARGIN} from '../utils';
2121

22-
export const Button = createReactComponent(ButtonApi, ({props, buildChild}) => {
22+
export const Button = createComponentImplementation(ButtonApi, ({props, buildChild}) => {
2323
const style: React.CSSProperties = {
2424
margin: LEAF_MARGIN,
2525
padding: '8px 16px',

renderers/react/src/v0_9/catalog/basic/components/Card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
import React from 'react';
18-
import {createReactComponent} from '../../../adapter';
18+
import {createComponentImplementation} from '../../../adapter';
1919
import {CardApi} from '@a2ui/web_core/v0_9/basic_catalog';
2020
import {getBaseContainerStyle} from '../utils';
2121

22-
export const Card = createReactComponent(CardApi, ({props, buildChild}) => {
22+
export const Card = createComponentImplementation(CardApi, ({props, buildChild}) => {
2323
const style: React.CSSProperties = {
2424
...getBaseContainerStyle(),
2525
backgroundColor: '#fff',

renderers/react/src/v0_9/catalog/basic/components/CheckBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
import React from 'react';
18-
import {createReactComponent} from '../../../adapter';
18+
import {createComponentImplementation} from '../../../adapter';
1919
import {CheckBoxApi} from '@a2ui/web_core/v0_9/basic_catalog';
2020
import {LEAF_MARGIN} from '../utils';
2121

22-
export const CheckBox = createReactComponent(CheckBoxApi, ({props}) => {
22+
export const CheckBox = createComponentImplementation(CheckBoxApi, ({props}) => {
2323
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
2424
props.setValue(e.target.checked);
2525
};

renderers/react/src/v0_9/catalog/basic/components/ChoicePicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import React, {useState} from 'react';
18-
import {createReactComponent} from '../../../adapter';
18+
import {createComponentImplementation} from '../../../adapter';
1919
import {ChoicePickerApi} from '@a2ui/web_core/v0_9/basic_catalog';
2020
import {LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS} from '../utils';
2121

@@ -24,7 +24,7 @@ import {LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS} from '../utils';
2424
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2525
type _Option = any;
2626

27-
export const ChoicePicker = createReactComponent(ChoicePickerApi, ({props, context}) => {
27+
export const ChoicePicker = createComponentImplementation(ChoicePickerApi, ({props, context}) => {
2828
const [filter, setFilter] = useState('');
2929

3030
const values = Array.isArray(props.value) ? props.value : [];

renderers/react/src/v0_9/catalog/basic/components/Column.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {createReactComponent} from '../../../adapter';
17+
import {createComponentImplementation} from '../../../adapter';
1818
import {ColumnApi} from '@a2ui/web_core/v0_9/basic_catalog';
1919
import {ChildList} from './ChildList';
2020
import {mapJustify, mapAlign} from '../utils';
2121

22-
export const Column = createReactComponent(ColumnApi, ({props, buildChild, context}) => {
22+
export const Column = createComponentImplementation(ColumnApi, ({props, buildChild, context}) => {
2323
return (
2424
<div
2525
style={{

renderers/react/src/v0_9/catalog/basic/components/DateTimeInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
import React from 'react';
18-
import {createReactComponent} from '../../../adapter';
18+
import {createComponentImplementation} from '../../../adapter';
1919
import {DateTimeInputApi} from '@a2ui/web_core/v0_9/basic_catalog';
2020
import {LEAF_MARGIN, STANDARD_BORDER, STANDARD_RADIUS} from '../utils';
2121

22-
export const DateTimeInput = createReactComponent(DateTimeInputApi, ({props}) => {
22+
export const DateTimeInput = createComponentImplementation(DateTimeInputApi, ({props}) => {
2323
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
2424
props.setValue(e.target.value);
2525
};

renderers/react/src/v0_9/catalog/basic/components/Divider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
import React from 'react';
18-
import {createReactComponent} from '../../../adapter';
18+
import {createComponentImplementation} from '../../../adapter';
1919
import {DividerApi} from '@a2ui/web_core/v0_9/basic_catalog';
2020
import {LEAF_MARGIN} from '../utils';
2121

22-
export const Divider = createReactComponent(DividerApi, ({props}) => {
22+
export const Divider = createComponentImplementation(DividerApi, ({props}) => {
2323
const isVertical = props.axis === 'vertical';
2424
const style: React.CSSProperties = {
2525
margin: LEAF_MARGIN,

0 commit comments

Comments
 (0)