generator-react-sdk icon indicating copy to clipboard operation
generator-react-sdk copied to clipboard

feat: update dependencies

Open leon19 opened this issue 1 year ago • 6 comments

Description

  • Update dependencies

Related issue(s)

Fixes #208

leon19 avatar Mar 13 '24 23:03 leon19

@jonaslagoni I tested it at work with react@18 and it worked, for some reason it got installed instead of react@17 and it was breaking our build. I used patch-package to add the export to the [email protected] file and it worked just fine.

Sadly, I have tried to set it up locally with @asyncapi/cli and @asyncapi/html-template and I'm not able to get it to work 😞

WIll try to find out if the upgrade is possible when I have the time 👌

leon19 avatar Mar 20 '24 20:03 leon19

I would probably try with just Generator and HTML-template (skipping CLI for simplicity) and using NPM link 🤔

Definitely need that test to go through 😄

jonaslagoni avatar Mar 22 '24 15:03 jonaslagoni

@jonaslagoni I was able to test it as you mentioned. It failed 😅

This change is needed in the template to get it to work

 export function renderSpec(asyncapi, params) {
   loadLanguagesConfig();
   const config = prepareConfiguration(params);
   const stringified = stringifySpec(asyncapi);
   const component = <AsyncApiComponent schema={stringified} config={config}/>;
-  return ReactDOMServer.renderToString(component);
+  return ReactDOMServer.renderToString(() => component);
 }

The good news is that by updating only that line, the generator still works with react@17

But yes, this PR cannot be merged before applying the change in the HTML template

leon19 avatar Mar 22 '24 17:03 leon19

Hello, @leon19! 👋🏼

    I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand!

    At the moment the following comments are supported in pull requests:

    - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
    - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
    - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.

asyncapi-bot avatar Mar 22 '24 17:03 asyncapi-bot

@leon19 so looks like that even if we fix HTML template, the upgrade is a breaking change for generator that depends on react sdk

derberg avatar Aug 11 '24 18:08 derberg