-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: rename createWebComponent method #19309
Conversation
Rename the createWebComponent function as the create gives the impression that the function is heavy.
@@ -446,7 +446,7 @@ interface Properties { | |||
* @param onload optional callback to be called for script onload | |||
* @param onerror optional callback for error loading the script | |||
*/ | |||
export const createWebComponent = (tag: string, props?: Properties, onload?: () => void, onerror?: (err:any) => void) => { | |||
export const webComponentTSX = (tag: string, props?: Properties, onload?: () => void, onerror?: (err:any) => void) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this limited to work with TSX only, or could it even be just short as webComponent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it returns a React element
and not a webComponent
. Another that was was getWebComponent
, but that also feels missleading.
Should it actually be flowReactElement
? This would not mix in webComponent into the name as it would explicitly name what is done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just reactElement
then. It's imported from a file called Flow, so context is already known by the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reactElement
sounds good to me as well.
TSX
postfix is not needed IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed.
TSX was only for if it was webComponent so you would know what to expect as you are not getting a webComponent.
This has a chance to be included into 24.4 for better DX, so I've added the cherry-pick label for 24.4. |
Let's wait for another opinions for a while. |
Updated documentation to use the new method name after refactor in vaadin/flow#19309
Quality Gate passedIssues Measures |
I like |
* fix!: rename createWebComponent method Rename the createWebComponent function as the create gives the impression that the function is heavy. * renameMethod to reactElement --------- Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
* fix!: rename createWebComponent method Rename the createWebComponent function as the create gives the impression that the function is heavy. * renameMethod to reactElement --------- Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
Updated documentation to use the new method name after refactor in vaadin/flow#19309 Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version. |
Rename the createWebComponent function
as the create gives the impression that
the function is heavy.