Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-initialize repository with latest Nx, React v18, and MUI v5/6 #717

Open
WilliamKelley opened this issue Nov 16, 2023 · 1 comment
Open

Comments

@WilliamKelley
Copy link
Contributor

WilliamKelley commented Nov 16, 2023

This repository needs to transition from its current state that's locked into a few realities, to a new state that represents a major upgrade. That's the TLDR, but here's the details:

Current state. In order of consequence:

  • @prenda/spark, @prenda/spark-icons v2.0.0-alpha.##
    • have peer-dependency on MUI v4
  • MUI v4
  • React v17
    • because of MUI v4
  • Nx v13.9.7
    • because of React v17
    • the last version before React v18 must be adopted (v13.10.0)
      • When doing the series of Nx upgrades, I remember trying to make v13.10+ work by manually downgrading React or installing v17 under an alias. I remember things going wrong. But i don't have details to share, I'd have to try it again.
    • controls:
      • Storybook v6.4.22
      • Jest v27.2.3
      • TypeScript v4.3.5
      • React v17

Desired state

  • @prenda/components, @prenda/icons v1.0.0-alpha.##
    • have dependency (not peer) on MUI v5/6
  • MUI v5/6
  • React v18.2.0 (latest)
    • because of MUI v5/6
  • Nx v17.1 (latest)
    • because supports React v18.2
    • upgrade of 4 major version, many more minors
    • see the minor release history, so many things we can benefit from, i'm highlighting the major ones here
    • controls:
      • Storybook v7.5.3
      • Jest v29.4.1
      • TypeScript v5.2.2

The primary blocker is that we can't maintain two versions of React at the same time and keep using Nx to develop -- we need its tailored environment of dependencies and tools that work together. We need to migrate to React v18 so we can update Nx. Since React v18 is not supported by MUI v4, we need to simultaneously update MUI to v5 (or v6 if available).

So what does that mean in terms of actual steps/work? Well, basically rewriting the libraries entirely. We do not use MUI v4 in a way that's normal for consumers, so most of the migration guide really doesn't apply to us. We take a highly tailored approach towards customization, not just working with the material-design-ish theme, but adding and changing props, adding new classes, slots, components, re-implementing components, deeply customizing theme and built-in utils, re-defining a default theme, etc. The list goes on.

Okay so full rewrite. I don't see a path forward that allows us to keep things side by side.

But, we don't have to release all at once. Instead I propose erasing the current state, step-by-step to allow for careful review and history. Then, rebuild a modern Nx repo from scratch (having the added benefit of not carrying all the cruft that got carried through in migrations: CRA -> TSDX -> Nx). We create two new packages, still under the @prenda namespace, but dropping the long-deprecated "spark" moniker. We can call the packages just "components" and "icons". We then install MUI v5/6, and rebuild things one-by-one.

@WilliamKelley WilliamKelley changed the title Re-initialize repository to use latest Nx, React v18, and MUI v5/6 Re-initialize repository with latest Nx, React v18, and MUI v5/6 Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant