sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Update SPFx modules to newer versions of React and TypeScript

Open AJIXuMuK opened this issue 9 years ago • 11 comments

Category

  • [x] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

Do you plan to update SPFx modules to newer versions of React (@types/react) and TypeScript? There is an issue right now with usage of Office UI Fabric React: versions after 4.29.0 are based on @types/react 15.0.38 that is not backward compatible with previous versions. And also uses features of TypeScript 2.3. So, now there is no way to use latest versions of Office UI Fabric React in SPFx projects.

Steps to Reproduce

yo @microsoft/generator
npm i office-ui-fabric-react
add some Office UI Fabric Control to your code
gulp

AJIXuMuK avatar Aug 04 '17 17:08 AJIXuMuK

@AJIXuMuK, what is the React version in your SPFx installation ?

manishgarg1 avatar Aug 07 '17 16:08 manishgarg1

Also - what version of OUIFR got installed - 4.30.1 ?

patmill avatar Aug 07 '17 16:08 patmill

@manishgarg1 just after scaffolding: screen shot 2017-08-07 at 10 03 20 am

@patmill I've tried 4.29.0 and 4.30.0. 4.29.0 is the one that is based on @types/react 15.0.38

SPFx, as I understand, uses office-ui-fabric-react of version 2.31.0 and @types/react of version 0.14.46

AJIXuMuK avatar Aug 07 '17 17:08 AJIXuMuK

Correct - you'll want a version that doesn't require the react 15 typings / TS 2.4.

patmill avatar Aug 07 '17 17:08 patmill

@patmill I'm using version 4.21.2 of office-ui-fabric-react for now. This one works good with SPFx and doesn't have bugs that are there in 4.28.0 (which is the last one that works with SPFx). But the initial question is if you're planning to update SPFx core to move forward latest version of office-ui-fabric-react.

AJIXuMuK avatar Aug 07 '17 17:08 AJIXuMuK

@AJIXuMuK - Yes, support for TS 2.4 / React 15 typings is on our roadmap and we intent to support them soon.

patmill avatar Aug 07 '17 17:08 patmill

To add some additional urgency to get to the latest this is also now breaking the BotFramework WebChat stuff. They've moved up to latest and it's now not compatible within the SPFx React web part, I've had to go back to angularjs for now because the webchat features are more important than the surround SPFx web part bits.

dependencies: { @ types/react': '15.0.38', 'botframework-directlinejs': '0.9.10', 'core-js': '2.4.1', 'markdown-it': '8.3.1', 'microsoft-adaptivecards': '0.6.0', 'microsoft-speech-browser-sdk': '0.0.1', react: '15.6.1', 'react-dom': '15.6.1', 'react-redux': '5.0.5', redux: '3.7.2', 'redux-observable': '0.13.0', rxjs: '5.3.3', tslib: '1.7.1' },

weshackett avatar Aug 08 '17 07:08 weshackett

@patmill is it possible to update 1.1.0 version (used for SharePoint 2016) to typescript 2.4 (or latest version)?
1.1.0 also has some issues with typings are not supported in TS 2.2 (used by SPFx 1.1)?

s-KaiNet avatar Jan 18 '18 09:01 s-KaiNet

@patmill As Latest Office-ui-fabric support TS 2.4. and SPFX webpart ( SharePoint 2016 ) supports 2.2.x. It is giving typescripts error when I am trying to use Office-ui-fabric. By When SPFX Typescript will get upgraded to 2.4?? OR is there any work around ?

avinash-sah24 avatar Feb 11 '18 17:02 avinash-sah24

It seems that you cant use Office UI Fabric React with SPFX due to different ts versions both packages requires so why create product and use outdated libraries versions ?

HeToC avatar May 18 '18 08:05 HeToC

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 29 '20 06:01 msft-github-bot