Uploaded image for project: 'OpenShift Console'
  1. OpenShift Console
  2. CONSOLE-3671

OCP 4.14 - Prepare to migrate react-router v5 API usage to v6

    XMLWordPrintable

Details

    • Epic
    • Resolution: Done
    • Major
    • openshift-4.14
    • None
    • None
    • None
    • OCP 4.14 - Migrate react-router v5 API usage to v6
    • False
    • None
    • False
    • Not Selected
    • To Do
    • 100
    • 100% 100%

    Description

      One of the requirements for adopting OpenShift Dynamic Plugin SDK (which is the new version of HAC Core SDK) is to bump the version of react-router to version 6. With Console PR #12861 merged, both Console web application and its dynamic plugins should now be able to start migrating from React Router v5 to v6. 

       

      As a team we decided that we are going to split the work per package, but for the core console we will split the work into standalone stories based on the migration strategy.
       
      Console will keep supporting React Router v5 for two releases (end of 4.15) as per CONSOLE-3662.
       
      How to prepare your dynamic plugin for React Router v5 to v6 migration:
      [0] bump @openshift-console/dynamic-plugin-sdk-webpack dependency to 0.0.10 * this release adds react-router-dom-v5-compat to Console provided shared modules

      [1] (optional but recommended) bump react-router and react-router-dom dependencies to v5 latest * Console provided shared module version of react-router and react-router-dom is 5.3.4

      • DO NOT bump react-router and react-router-dom dependencies to v6!

      [2] add react-router-dom-v5-compat dependency * Console provided shared module version of react-router-dom-v5-compat is 6.11.2

      • this package provides React Router v6 code which can interoperate with v5 code

      [3] start migrating to React Router v6 APIs * v5 code is imported from react-router or react-router-dom

      • v6 code is imported from react-router-dom-v5-compat
      • follow the official React Router Migration Strategy

      [4] (optional but recommended) use appropriate TypeScript typings for react-router and react-router-dom * Console uses @types/react-router version 5.1.20 and @types/react-router-dom version 5.3.3

      • note that react-router-dom-v5-compat already ships with its own typings

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jhadvig@redhat.com Jakub Hadvig
              Xiyun Zhao Xiyun Zhao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: