communication-ui-library icon indicating copy to clipboard operation
communication-ui-library copied to clipboard

Support React 18

Open juandgarin opened this issue 2 years ago • 13 comments

When i try to install the library, it returns me an error indicating that there are dependencies that cant resolve.

Anyone with the same problem?

I think it is a React 18 issue

Screenshot 2022-05-17 at 06 09 36

juandgarin avatar May 17 '22 09:05 juandgarin

Hi @juandgarin, thank you for filing this issue. I will look into this today.

mgamis-msft avatar May 17 '22 17:05 mgamis-msft

Hi @juandgarin, our dependency on fluent ui library restricts our package from using React 18 or higher. What is your use case for [email protected]? Is it possible to use another version of backoffice that does not rely on React 18?

mgamis-msft avatar May 18 '22 00:05 mgamis-msft

Hi @juandgarin I don't expect us to be able to lift the < React18 requirement easily at the moment (Fluentv8 recently moved to React 17, and I'm not aware of any plans to move beyond React18+)

Closing this issue as it is not currently actionable, but please feel free re-open with any more information / insight you have for the need for React 18+

prprabhu-ms avatar May 30 '22 21:05 prprabhu-ms

Actually, let's keep this open to track when FluentUI goes to React 18 and then this issue will be actionable: https://github.com/microsoft/fluentui/issues/22592

prprabhu-ms avatar May 30 '22 21:05 prprabhu-ms

It is still unclear if Fluentv8 will gain React18 support at all: https://github.com/microsoft/fluentui/issues/22592#issuecomment-1113633465

prprabhu-ms avatar May 30 '22 21:05 prprabhu-ms

I am also facing the same issue when I followed these steps. https://azure.github.io/communication-ui-library/?path=/docs/quickstarts-uicomponents--page

sai0909 avatar Jun 01 '22 09:06 sai0909

@sai0909 Can you try downgrading to React v17 to see if it fixes your issue?

prprabhu-ms avatar Jun 03 '22 18:06 prprabhu-ms

It is a big problem that anybody using our quickstart will currently hit the problem posted in OP.

I confirmed that downgrading the app to React 17 with

npm install react@17 react-dom@17 @testing-library/react@12 @types/react@17 @types/react-dom@17

almost fixes the issue. The problem is that react-dom had a breaking change from v17 -> v18 so that the create-react-app generated boilerplate doesn't work with React 17.

If you modify the generated index.tsx to be

import React from 'react';
import { render }  from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const container = document.getElementById('root');
render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  container
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

Then the quickstart works correctly.

But... that is terrible devX. Still looking for less manual workarounds.

prprabhu-ms avatar Jun 03 '22 22:06 prprabhu-ms

Honestly, this is a fairly large feature gap in create-react-app. There is no way to use an older version of react libraries with that tool. Maybe they'll have a fix for it soon... https://github.com/facebook/create-react-app/issues/12269

prprabhu-ms avatar Jun 17 '22 17:06 prprabhu-ms

It's not only about CRA. Next.js has their own CLI for creating new apps and usage of latest version will always bring React 18+.

I understand the complexity of migration, but not supporting new versions of React just places Fluent UI React as no-go for new React-based projects.

Of course I can downgrade, but I will lack of new Next.js features.

piotrzaborow avatar Jun 21 '22 13:06 piotrzaborow

@piotrzaborow we're following up on both forks:

  • Track Fluent UI React upgrade to React 18
  • Deliver a workaround that unbreaks new apps using @azure/communication-react right now.

I learnt that it is possible to set React versions via CRA templates, so we will explore that option in the short term.

prprabhu-ms avatar Jun 23 '22 20:06 prprabhu-ms

I'm working on React 18 support in Fluent UI right now. The changes in Strict mode are causing a good bit of churn, so we have some work ahead of us to get all of our controls working properly in React 18. For clarity, what version of Fluent UI is your package dependent on?

micahgodbolt avatar Jul 22 '22 19:07 micahgodbolt

It took longer than expected, but peer deps have been updated. Both v8 and v9 will be usable within react 18 upon the next release.

micahgodbolt avatar Oct 13 '22 20:10 micahgodbolt

@micahgodbolt - Do you have plans or know when the communication-ui-library will be upgraded to using v9 of Fluent UI ?

krista-m-bledsoe avatar Oct 27 '22 19:10 krista-m-bledsoe

Hi @micahgodbolt, while the @fluentui/react warning has now disappeared for me, I've still got a few others.

image

Do you know when the updated peer dependencies for @azure/communication-react and bundled dependency upgrades, will be published? For example, I can see that @fluentui/react-northstar is a fixed dependency in @azure/communication-react at v0.61.0, however they have published v0.65.0.

develohpanda avatar Nov 16 '22 20:11 develohpanda

@develohpanda we have made progress on most dependencies, but we have a final blocker from permitting react 18 as a peer dependency on https://github.com/microsoft/fluentui/issues/25651

JamesBurnside avatar Nov 17 '22 20:11 JamesBurnside

@JamesBurnside that's awesome! Please let me know if there's anything I can do to help it along. :)

develohpanda avatar Nov 17 '22 22:11 develohpanda

Yeah the only reason our projects are held up for react 18 is this package please re consider supporting react 18

hyunoosung avatar Jan 03 '23 10:01 hyunoosung

Hi @micahgodbolt, while the @fluentui/react warning has now disappeared for me, I've still got a few others.

image

Do you know when the updated peer dependencies for @azure/communication-react and bundled dependency upgrades, will be published? For example, I can see that @fluentui/react-northstar is a fixed dependency in @azure/communication-react at v0.61.0, however they have published v0.65.0.

The northstar project was originally under under Teams engineering. @jurokapsiar would be the best one to talk to about React 18 support. Do you know how critical the northstar dependency is for your package?

micahgodbolt avatar Jan 18 '23 16:01 micahgodbolt

Presumably quite important as we are using the acs libraries to embed Teams within our site. I could try and track that dependency through the GitHub packages.

develohpanda avatar Jan 18 '23 20:01 develohpanda

It's been almost a year since the first report. May I ask if this has any progress?

hyunoosung avatar Feb 17 '23 09:02 hyunoosung

I would suggest looking to see if you can remove the northstar dependency from this library. You should be able to migrate most Northstar code to v9 now.

https://react.fluentui.dev/?path=/docs/concepts-migration-from-v0-components-avatar-migration--page

micahgodbolt avatar Feb 21 '23 22:02 micahgodbolt

We need React 18 support as it preventing us from moving forward to upgrade our other application to React, as we have strict policies to keep package versions consistent across our applications.

It's also preventing us from using Next.js

FullStackSteve avatar Mar 01 '23 12:03 FullStackSteve

Basically, this is the only reason our applications are held up for react 18.

norbert-guider avatar Mar 08 '23 12:03 norbert-guider

This is a huge blocker. We're now stuck between requiring React 18 for our development needs, other packages, using Next.js on one side and just azure communication not supporting React 18 on the other.

jakub-guider avatar Mar 08 '23 12:03 jakub-guider

@prprabhu-ms is this still blocked?

Looks like fluentui now fully supports React 18 (albeit @fluentui/react-northstar is now discontinued so as @micahgodbolt suggests it would need to be removed from Azure/communication-ui-library so that React 18 can be supported)

FullStackSteve avatar Mar 08 '23 12:03 FullStackSteve

@prprabhu-ms is this still blocked?

Looks like https://github.com/microsoft/fluentui fully supports React 18 (albeit @fluentui/react-northstar is now discontinued so as @micahgodbolt suggests it would need to be removed from Azure/communication-ui-library so that React 18 can be supported)

Does it mean that they only need to update the fluent ui dependency? Or is there some migration required? It feels like taking forever.

hyunoosung avatar Mar 08 '23 12:03 hyunoosung

I’m using the ChatComposite passing the ChatAdapter in a Stack that I couldn’t see how to upgrade to FluentUI v9.

The docs says that it doesn’t support React 18!

Currently the Azure Communications UI library supports react versions >=16.8.0 and < 18

https://azure.github.io/communication-ui-library/?path=/docs/setup-communication-react--page

DercilioFontes avatar Mar 08 '23 14:03 DercilioFontes

any updates on this?

yxor avatar Mar 10 '23 11:03 yxor

i am working on lots of projects related to this library. May we know the status on this or if there is anything we can contribute to make this transition faster?

realjesset avatar Mar 12 '23 08:03 realjesset