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

fix(frontend): update mui Tree* dependency for FieldsView.tsx #104

Conversation

jeffycyang
Copy link
Contributor

@jeffycyang jeffycyang commented Aug 6, 2024

Description

I've been using opendiffy/diffy and building from source with some customization. Upon doing so I've noticed the default frontend @mui/lab Tree* components have been deprecated and now must be imported from @mui/x-tree-view with TreeView having been renamed to SimpleTreeView as well as some slight changes in component props to both SimpleTreeView and TreeItem.

Changes

Adds @mui/x-tree-view as frontend dependency and replace TreeView & TreeItem to be imported from aforementioned package with migrated syntax following the following docs:

Bug Reproduction & Testing Change

One can verify the bug by standing up the docker-compose stack, building the diffy image from source locally by replacing L53 in docker-compose.yml with something like:

    image: local_diffy:latest
    build:
      context: .
      dockerfile: Dockerfile 

On master:

  1. stand up docker compose stack locally building diffy from source following the above modification to the compose file, ex. docker compose -p diffy-local -f docker-compose.yml up --build

  2. make a request to the diffy server at 8880 (request failure doesn't matter for this bug reproduction), ex.

     curl -v -X --url="http://localhost:8880"
    
  3. navigate to the frontend at http://localhost:8888

  4. clicking on the entry on the left hand Endpoints list will show nothing under right side Fields and there will be a warning in the developer console about the deprecation, see screenshot:

Screenshot 2024-08-06 at 12 08 51 AM

Do the same on this branch (building diffy image from source) and it will work as it did before, screenshot for reference:

Screenshot 2024-08-06 at 12 57 35 AM

Additional Context & Consideration

The current diff/diffy:latest image, does not have this problem likely due to a frontend docker build cache with a @mui/lab version prior to the deprecation.

It might be worth considering adding a frontend dependency lock file so this issue does not arise for future users who choose to build from source.

@jeffycyang jeffycyang marked this pull request as ready for review August 6, 2024 12:23
@puneetkhanduri puneetkhanduri merged commit a6e0493 into opendiffy:master Aug 6, 2024
5 of 7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants