Broadleaf Microservices
  • v1.0.0-latest-prod

Upgrading OpenApi to 1.8.2

Table of Contents

Overview

  • The minimum recommended node version is 18 because v14 reaches end-of-life (EOL) in April 2023 followed by v16 in September 2023.

  • The minimum version of React has been upgraded to v17 which should not require any additional changes.

    • Future versions will require v18 which will potentially include migration steps.

Node 18 Support

Due to Node 14 reaching end of life in April 2023 and Node 16 a few months later, we have made changes to ensure that Node 18 (current LTS) is supported. This includes some required dependency updates.

Tip
We recommend that Clients just re-clone our OpenApi app from their Starter project and then copy any API spec changes they’ve made on top.

The key migration steps will be covered by the following:

  • Husky: See typicode’s guide to go from v4 to v8 https://github.com/typicode/husky-4-to-8

  • Tailwind: See their v1-v2 upgrade guide, https://v2.tailwindcss.com/docs/upgrading-to-v2,

  • We added GENERATE_SOURCEMAP=false to our .env after upgrading swagger with the other dependencies because of a typescript error

  • We also added --transformIgnorePatterns \"node_modules/(?!@swagger-ui-react)/\" to the commands in package.json to run tests for similar reason

    • "test": "react-scripts test --env=jsdom --transformIgnorePatterns \"node_modules/(?!@swagger-ui-react)/\"",

    • Lint-staged: "react-scripts test --env=jsdom --transformIgnorePatterns \"node_modules/(?!@swagger-ui-react)/\" --watchAll=false --bail --findRelatedTests"

  • We changed imports of types to use the import type syntax to indicate to the transpiler they are not needed at runtime

  • In the Environment.test.ts, changed delete window.env to window.env = {} since it is not nullable (can’t use delete on that property)

  • Added tailwind.config.js to the include list in tsconfig.json (assuming tailwind was upgraded)