Skip to content

feat: @asyncapi/react-componet upgraded to v2 together with react#708

Merged
asyncapi-bot merged 3 commits intoasyncapi:masterfrom
neoandmatrix:react-component-upgrade
Feb 18, 2025
Merged

feat: @asyncapi/react-componet upgraded to v2 together with react#708
asyncapi-bot merged 3 commits intoasyncapi:masterfrom
neoandmatrix:react-component-upgrade

Conversation

@neoandmatrix
Copy link
Contributor

Description

This PR introduces the changes to upgrade the @asyncapi/react-component to it's latest version 2.5.1. The extra added dependency react is to allow installation of newer react-dom as required by @asyncapi/react-component.

The tests are updated as well and are all passing.

image

Related issue(s)
Resolves #707

@derberg please review the PR and provide feedback.

Thanks.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@derberg derberg changed the title feat: react-componet upgraded feat: @asyncapi/react-componet upgraded to v2 together with react Feb 13, 2025
derberg
derberg previously approved these changes Feb 13, 2025
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

lgtm, thanks a lot

@derberg
Copy link
Member

derberg commented Feb 13, 2025

@neoandmatrix please look into failing tests

@neoandmatrix
Copy link
Contributor Author

@neoandmatrix please look into failing tests

Sure, will check and update.

Thanks.

@neoandmatrix
Copy link
Contributor Author

Hey @derberg was working on the failing tests and after some debugging found the cause to be this method
image at helpers/all.js in renderSpec function. The corresponding error Generator Error: window is not defined might be due to changes in newer version of react that might require browser functions or some dom functions. I was initially suspicious that this might be the as we are cause as we are using react-dom/server but just to confirm i tried using jsdom library to simulate the required browser functions as
image

and the generator worked as expected and correct output files were being generated. But this caused a new problem that after generating the template the generator is stuck and fails to exit only only exits upon using ctrl+c to manually exit it.

Can you please provide some feedback on if my approach is correct and if so then what might be probable cause of this being not exiting on itself. If some docs or material should be that i can refer please provide that will be much helpful for me.

Thanks.

@derberg
Copy link
Member

derberg commented Feb 17, 2025

@neoandmatrix you need to push your changes to PR so I can have a closer look

@neoandmatrix
Copy link
Contributor Author

@neoandmatrix you need to push your changes to PR so I can have a closer look

@derberg Pushed the changes. Please review and provide feedback.
Thnaks.

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@derberg
Copy link
Member

derberg commented Feb 17, 2025

I tried your changes on local, using npm run test:generator:v3 and your solution works, and cli terminates without issues.

also looks like tests are passing here too

@neoandmatrix
Copy link
Contributor Author

I tried your changes on local, using npm run test:generator:v3 and your solution works, and cli terminates without issues.

also looks like tests are passing here too

Oh that's good then, looks like some older cache might be causing issue on my system then.

@sonarqubecloud
Copy link

@derberg
Copy link
Member

derberg commented Feb 18, 2025

/rtm

@asyncapi-bot asyncapi-bot merged commit beb50dd into asyncapi:master Feb 18, 2025
11 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@derberg
Copy link
Member

derberg commented Feb 18, 2025

@all-contributors please add @neoandmatrix for code

@allcontributors
Copy link
Contributor

@derberg

I've put up a pull request to add @neoandmatrix! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade @asyncapi/react-component dependency major version from 1 to 2

3 participants