Repository: tensorflow/model-analysis
Issue: Jupyterlab v3 extension support
Root cause: External Dependency Breakage

### System information

-   **Have I written custom code (as opposed to using a stock example script
    provided in TensorFlow Model Analysis)**: N/A
-   **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Tested in MacOS, would like support for Linux CentOS 7
-   **TensorFlow Model Analysis installed from (source or binary)**: PyPI binary
-   **TensorFlow Model Analysis version (use command below)**: 0.27.0
-   **Python version**: 3.6
-   **Jupyter Notebook version**: Using jupyterlab v3.0.11 
-   **Exact command to reproduce**:
**Installing TFMA**
```
$  pip install tensorflow_model_analysis==0.27.0
$ jupyter labextension install tensorflow_model_analysis@0.27.0
$ pip install jupyterlab_widgets
$ jupyter labextension list
JupyterLab v3.0.11
/Users/mwakabayashi/opt/anaconda3/envs/jupyterlab3/share/jupyter/labextensions
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /Users/mwakabayashi/opt/anaconda3/envs/jupyterlab3/share/jupyter/lab
        tensorflow_model_analysis v0.27.0 enabled OK
```
**Running TFMA basic notebook**
1. `jupyter lab`
2. Ran the [TFMA basic notebook](https://www.tensorflow.org/tfx/tutorials/model_analysis/tfma_basic) with `tensorflow==2.3.0`.

### Describe the problem

[Jupyterlab](https://blog.jupyter.org/jupyterlab-3-0-is-out-4f58385e25bb) 3.0 was released in January 2021. Would it be possible to get v3 support (install TFMA as a prebuilt extension) soon? At Twitter, we'd like to migrate to Jupyterlab 3 from 2, but we can't without v3 support for TFMA.

### Source code / logs

**Error after running `render_slicing_metrics` function.** 
<img width="794" alt="Screen Shot 2021-03-18 at 3 14 47 PM" src="https://user-images.githubusercontent.com/3497137/111698709-c44fbb00-87fc-11eb-98a3-7ef615892bbd.png">

**In Chrome developer console**
<img width="723" alt="Screen Shot 2021-03-18 at 2 57 29 PM" src="https://user-images.githubusercontent.com/3497137/111698719-c6197e80-87fc-11eb-97e6-d5b5d4691e1c.png">
<img width="732" alt="Screen Shot 2021-03-18 at 2 57 38 PM" src="https://user-images.githubusercontent.com/3497137/111698726-c7e34200-87fc-11eb-89c5-84eb620c2dcf.png">



@mdreves Would it be possible to get a rough ETA on this? We'd ideally like to have this support by early May. 

I believe it's already supported with tfma>=0.29.0?

@fhuanming to confirm

@fhuanming I got 0.27.0 working on jupyterlab v3 by updating the package.json file's dependencies and jupyterlab attributes and rebuilding. 

I think adding the `sharedPackages` configuration fixed the `No provider for: jupyter.extensions.JupyterWidgetRegistry` error.
```json
// model-analysis/tensorflow_model_analysis/notebook/jupyter/js/package.json 
...
"dependencies": {
    "@jupyter-widgets/base": "^1.1 || ^2 || ^3 || ^4",
    "lodash": "^4.17.4"
  },
  "jupyterlab": {
    "extension": "lib/labplugin",
    "sharedPackages": {
      "@jupyter-widgets/base": {
        "bundled": false,
        "singleton": true
      }
    }
  },
```
Can we get this updated for 0.27.0?

Hi @mwakaba2,

Seems this is already updated? : https://github.com/tensorflow/model-analysis/blob/master/tensorflow_model_analysis/notebook/jupyter/js/package.json

Would you mind giving it a try of 0.28.0 ?

Thanks



Hi @fhuanming It's updated on the master branch, but not on branch r0.27.0. 

Yes, it's fixed  >=0.28.0, not in 0.27.0. Do you have any issue to upgrade to 0.28.0 ?

I see, no technical issue. We depend on another team to get it upgraded, so I just wanted to see if it worked for 0.26.0 and 0.27.0. 

thanks for the help!