OfficeDev / Office-Addin-TaskPane-React

Template to get start started writing a TaskPane Office Add-in for the React framework using TypeScript
Other
53 stars 34 forks source link

Update React18 Fluent9 functional components and other fixes #127

Closed Rick-Kirkham closed 11 months ago

Rick-Kirkham commented 11 months ago

Change Description:

  1. Use React ver. 18

  2. Remove all react-hot-loader stuff because it is now built into React 18.

  3. Use functional components instead of class components and use React effects instead of lifecycle events for state management.

  4. Use Fluent React UI v9.

  5. Use the Fluent V9 "makeStyles" API for styling.

  6. Removed the unused "Commands" files and manifest markup.

  7. Remove the testing of whether Office is initialized. It served no purpose.

  8. Change the functionality of the resulting projects so that they show real world React state management. They all now insert text into the document.

  9. Add check in taskpane.html for Trident (IE) and Edge Legacy and gracefully fail if positive. I WOULD EXPECT THE IE AND EDGE LEGACY TESTS TO FAIL FOR THIS REASON. WE SHOULD PROBABLY JUST NOT HAVE THOSE TESTS FOR THIS TEMPLATE.

  10. Enforce Separation of Concerns by moving code that calls Office.js out of the React component modules and into their own modules.

  11. Update all unit and end2end tests to account for the above. THIS APPLIES ONLY TO THE WINDOWS TESTS. IF MAC AND WEB TESTS ALSO NEED TO CHANGE, I WILL NEED HELP WITH THAT.

  12. Use the actual production *.tsx component files for the end2end tests instead of a separate set of (near, but not exact) duplicate files.

  13. Update convertToSingleHost.js to account for all of the above.

  14. Remove code and files that would only be relevant if we were including tests in the emitted projects.

  15. Do these changes impact any npm scripts commands (in package.json)? (e.g., running 'npm run start') If Yes, briefly describe what is impacted. No

  16. Do these changes impact VS Code debugging options (launch.json)? If Yes, briefly describe what is impacted. No

  17. Do these changes impact template output? (e.g., add/remove file, update file location, update file contents) If Yes, briefly describe what is impacted. Yes. See Change Description above.

  18. Do these changes impact documentation? (e.g., a tutorial on https://docs.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins) If Yes, briefly describe what is impacted. Yes. The quickstart/tutorial for a React-based add-in will have to be changed and possibly other files too. THIS PR SHOULD NOT BE MERGED TO PRODUCTION UNTIL THE DOC REVISIONS ARE READY TO BE MERGED TOO. NEEDS TO HAPPEN AT THE SAME TIME.

If you answered yes to any of these please do the following:

Include 'Rick-Kirkham' in the review Make sure the README file is correct

Validation/testing performed:

All unit and end2end tests work locally. All emitted projects tested and they all work.

akrantz commented 11 months ago

@Rick-Kirkham It's better to create a different branch rather than use the master branch in your fork. You don't want to keep the extra commits in your fork and also merge back from the main repository especially if you use squash commit to complete the PR.

akrantz commented 11 months ago

Sorry I commented on the wrong PR accidentally.