Skip to content

continue componentization of existing client: packages/templates/clients/js/websocket/template/client.js.js #1349

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

Closed
derberg opened this issue Jan 29, 2025 · 4 comments · Fixed by #1407
Labels
enhancement New feature or request

Comments

@derberg
Copy link
Member

derberg commented Jan 29, 2025

Large part of https://github.com/asyncapi/generator/blob/master/packages/templates/clients/js/websocket/template/client.js.js is still "hardcoded" inside main fail. We should aim for granular componentization - but of course not because we need it, but of course we should do it only if it makes sense.

you can already see FileHeaderInfo and Requires there in action. Check the rest and propose new components.

remember they are like functions. So you do not want to have all the code in one function, with possible repetitions, and instead you devide your code into sections and push to components.

reading client.js.js should be super easy, you shoudl be able to understand what details it contains without really knowing exactly the entire code.

I hope that it makes sense

@derberg derberg converted this from a draft issue Jan 29, 2025
@derberg derberg added the enhancement New feature or request label Jan 29, 2025
@Bishoywadea
Copy link

iam working on this @derberg

@Adi-204
Copy link
Contributor

Adi-204 commented Mar 9, 2025

@derberg I reviewed the PR raised in this issue. According to me their are few logical errors as well because if we see the test cases which are failing is showing something like [object] [object] ... as shown below -

Image

After research I found out the issue happens because React components return objects, but using them inside a text-based output.
The contributor has also not replied since last week. Can I go ahead and raise PR?

@derberg
Copy link
Member Author

derberg commented Mar 10, 2025

@Adi-204 please share what you noticed directly in the PR. You can start working on PR once we close the other one. Let's see if the contributor makes any comments until Wednesday

@Adi-204
Copy link
Contributor

Adi-204 commented Mar 10, 2025

@derberg sir actually I notice that all the components are returning <Text> component from @asyncapi/generator-react-sdk but the contributor has wrapped all the components inside { ` <Text> .... </Text> ` } which is then converted to [object object].... you can see on this line. Ok we can wait till Wednesday and I will raise PR afterwards. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Archive
3 participants