amazon-chime-sdk-component-library-react icon indicating copy to clipboard operation
amazon-chime-sdk-component-library-react copied to clipboard

Support React 18 + TypeScript

Open kelvin-thinkbean opened this issue 2 years ago • 1 comments

What happened and what did you expect to happen?

After upgrading to React 18 in my Typescript project, I experienced several type related issues. This is because of the decision of the React team to remove implicit children (see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210).

There is a codemode provided which basically wraps all the props with React.PropsWithChildren<YourProps> which could come in handy for you.

Have you reviewed our existing documentation?

Reproduction steps

Amazon Chime SDK React Components Library version

3.0.0

What browsers are you seeing the problem on?

N/A

Browser version

N/A

Device Information

N/A

Meeting and Attendee ID Information.

No response

Browser console logs

N/A

Add any other context about the problem here.

No response

kelvin-thinkbean avatar Apr 14 '22 07:04 kelvin-thinkbean

Thanks for reporting this issue. We will provide more updates as we make progress. But for now we are tracking this internally.

devalevenkatesh avatar Apr 18 '22 20:04 devalevenkatesh

@kelvin-thinkbean amazon-chime-sdk-component-library-react peer dependencies include react v17. Did you use --force or --legacy-peer-deps to get react v18 installed?

everscending avatar Oct 24 '22 12:10 everscending

@devalevenkatesh are there immediate plans for upgrading the peer dep? it is blocking us from upgrading. thanks for a great lib!

beefancohen avatar Oct 27 '22 20:10 beefancohen

Hi @beefancohen ,

Thank you for trying out the library. Unfortunately, I am sad to tell we have not yet prioritized due to other priorities. I will keep this issue updated once we have an update. Thanks again!

devalevenkatesh avatar Oct 27 '22 20:10 devalevenkatesh

@devalevenkatesh thank you! would you accept a PR perhaps?

beefancohen avatar Oct 27 '22 20:10 beefancohen

Yes, definitely would like that. Though, there are multiple problem with React 18 upgrade for us and time consuming to fix. Below are the things we need to update in order:

  1. Storybook's @storybook/addon-knob is deprecated now and uses react 17, hence we have to move to use @storybook/addon-controls.
  2. react-popper and @popper/code-js need to be updated to 2.7.0. Check and test if PopOver or related components function properly which use react-popper.
  3. Update react, react-dom, @types/react, @types/react-dom to ^18.0.0 version.
  4. children should now be added as an explicit prop on all components using or rendering children elements.
  5. Also, not sure, but there are changes to useEffect cycle as well so have to test each and every component from that standpoint.

We did some progress and realized there're more than 70+ *.stories.tsx of UI Components need to be migrated from @storybook/addon-knob to @storybook/addon-controls.

Example: https://github.com/aws/amazon-chime-sdk-component-library-react/commit/ec959964af0cbfba7729ba294657c909e3f60d4f

devalevenkatesh avatar Oct 27 '22 21:10 devalevenkatesh

awesome ty... posting the migration instructions for storybook here for posterity: https://github.com/storybookjs/storybook/blob/next/code/addons/controls/README.md#how-do-i-migrate-from-addon-knobs

beefancohen avatar Oct 27 '22 21:10 beefancohen

The major issue for migrate to @storybook/addon-controls is that we need to update all our stories to arg based, the auto-generated args doesn't work well for our stories, so we have to manually do that.

xuesichao avatar Oct 27 '22 21:10 xuesichao

+1

iquirino avatar Oct 31 '22 23:10 iquirino

Still having the same problem with the last update (3.4.0), is there any workaround for this?

Robertorc83 avatar Nov 07 '22 13:11 Robertorc83

with react 17, I'm getting this issue with MeetingProvider, version 3.4.0

Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & Props'.ts(2559)

osamabinsaleem avatar Nov 08 '22 10:11 osamabinsaleem

Thanks for reporting @Robertorc83 and @osamabinsaleem . This is not a bug with the library rather React 18 is not supported yet with amazon-chime-sdk-component-library-react. Unfortunately we do not have a time frame to report on the progress yet, please check previous comment for more details.

devalevenkatesh avatar Nov 08 '22 16:11 devalevenkatesh

+1 Please. Is there any timeframe as of yet?

dmoughabghab avatar Nov 16 '22 10:11 dmoughabghab

+1 Please. Is there any timeframe as of yet?

woohelps avatar Nov 17 '22 21:11 woohelps

I made a version where I got rid of story book altogether and did all the adding children prop to components work and it builds successfully, do you want me to commit a branch where items 2, 3 and 4 are done?

dmoughabghab avatar Nov 23 '22 22:11 dmoughabghab

I published this version which is working on react 18 https://www.npmjs.com/package/chime-sdk-react-unoffical-18 I cut many corners making this and am only testing it and updating it based on my needs, use at your own risk

dmoughabghab avatar Dec 12 '22 14:12 dmoughabghab

+1

have been facing some issue in chime front end integration, and I am trying to use any tag from Amazon chime SDK component library react getting error.

Example tag : <VideoTile nameplate="Test name"/>

Chime version : "amazon-chime-sdk-component-library-react": "^3.4.0", "amazon-chime-sdk-js": "^3.9.0"

dependencies version : "react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",

gvnavin avatar Dec 22 '22 18:12 gvnavin

We built all our front end app using react 18. Since chime is not supported in react 18, we need to do lot of work around like creating a separate react app to compile down it to simple js code and include them in main app inside iframe. It caused lot of churn and delayed the project deliverables. We think that it is going to cause continuous maintanence issues.

I would request the team to prioritize this issue and upgrade the library.

Thank you.

gvnavin avatar Jan 24 '23 08:01 gvnavin

I am actually working on the react 18 implementation. Is it still something people need ? If yes as Its a ton of time consuming. Would you consider participating financially for the project that will implement it or is it something people will except to use freely ?

flozero avatar Mar 20 '23 20:03 flozero

Just so you know. I have started a react 18 implementation of it. If you want to read more and support the project please take time to star the project or support via github sponsor. I will make sure to keep the readme updated

https://github.com/flozero/react-18-chime-js-sdk

flozero avatar Mar 21 '23 19:03 flozero

For our use case, our team has been keeping a local fork of this repo updated to React 18. I'd like to start using the official package again and get this out of our monorepo.

Would be happy to take some time to fix the knobs + add the updates by this weekend. This library is integral to us, so I figure I can give back a little here.

Amethystix avatar Mar 22 '23 15:03 Amethystix

@Amethystix I have migrate everything into react 18 syntax here https://github.com/flozero/react-18-chime-js-sdk

You can install the package react-18-chime-js-sdk. I am finishing integrating this in my personal project and will offer this project to take backt he ownership if someone end up answering :)

flozero avatar Mar 28 '23 20:03 flozero

Thank you for your efforts in upgrading the library @Amethystix and @flozero and very sorry for delay in response to this. Currently, we are looking into the changes and working on a migration plan. If you have done significant work on knobs as well as all components we would appreciate if you could share the links, we would be happy to include your contributions as well as consider them as we plan to migrate.

Unfortunately, we still do not have a final plan and date to address this, we will communicate so once we have it.

devalevenkatesh avatar Mar 29 '23 21:03 devalevenkatesh

Thanks for answering @devalevenkatesh .

So far my repo have eveyrthing migrate into react 18 that include:

  • sdk
  • ui
  • all the providers

I found some potential issues that need to be investigate like background blur. But as we don't have the full plan from the aws chime I would guess its probably related to this.

I didn't add back the storyblok preview. But it something I can do. Would be happy to discuss with you more and show you the work if you are interested.

flozero avatar Mar 29 '23 22:03 flozero

Hi there, we wanted to give you an update on our react 18 support. We have recently updated our SDK to support React 18 in the react-18 branch of our GitHub repository, which you can find here: https://github.com/aws/amazon-chime-sdk-component-library-react/tree/react-18. While we are still in the process of migrating our storybook, the SDK itself has been fully upgraded.

Before we officially release this change, we would love to receive your feedback on this update. We appreciate any comments or suggestions you may have.

If you would like to give it a try, here're the steps:

  • check out react-18 branch and generate the tarball:
    git clone [email protected]:aws/amazon-chime-sdk-component-library-react.git
    git checkout react-18
    npm install
    npm run build
    npm pack
    
  • copy and paste the generated tarball in your project and install it
    npm install amazon-chime-sdk-component-library-react-3.6.0.tgz
    
  • play with your project and see if it breaks anything.

Thank you for your support and patience!

xuesichao avatar Apr 21 '23 17:04 xuesichao

Hi all, we just published [email protected] to npm. We added support for React 18 in this v3.7.0 version. Thanks again for your support and patience!

I'll close this issue for now, let us know if you run into any issue.

xuesichao avatar Jun 08 '23 21:06 xuesichao