rucio / jupyterlab-extension

Rucio Jupyterlab plugin (GSOC Project)
Apache License 2.0
7 stars 9 forks source link

Migrate code to support Lab3 (breaks lab2 compat) #2

Closed didithilmy closed 3 years ago

didithilmy commented 3 years ago

Migrate codebase to support JL3 according to this guide: https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html. Breaks compatibility to JL2.

Some quick fixes are used:

  1. The use of webpack.config.js with fullySpecified: false option is somehow required, or else the build fails. Might be a bug on Babel/Webpack (https://github.com/webpack/webpack/issues/11467)
  2. The use of resolutions on package.json is required due to dependency conflict between the new JL3 @types/react dependency and react-window. Fixes #1
didithilmy commented 3 years ago

Ah, one problem: If I run python -m jupyterlab.browser_check, it throws an error with the following stack trace:

Parsed an error from text content: undefined Warning: React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.%s

/Users/mhilmy/Documents/GitHub/jupyterlab-extension/venv/share/jupyter/lab/browser_test/chrome-test.js:55
  throw up;
  ^
true
(Use `node --trace-uncaught ...` to show where the exception was thrown)
[C 2021-02-25 17:18:03.685 ServerApp] Caught exception during the test:
Caught exception during the test:
[E 2021-02-25 17:18:03.685 ServerApp] ['node', 'chrome-test.js', 'file:///Users/mhilmy/Library/Jupyter/runtime/jpserver-2836-open.html'] exited with 1
['node', 'chrome-test.js', 'file:///Users/mhilmy/Library/Jupyter/runtime/jpserver-2836-open.html'] exited with 1
[I 2021-02-25 17:18:03.685 ServerApp] Test Complete
[C 2021-02-25 17:18:03.685 ServerApp] Exiting with 1 due to errors

I'm not sure why, maybe you have an experience with this? @diocas

didithilmy commented 3 years ago

Ah, one problem: If I run python -m jupyterlab.browser_check, it throws an error with the following stack trace:

Parsed an error from text content: undefined Warning: React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.%s

/Users/mhilmy/Documents/GitHub/jupyterlab-extension/venv/share/jupyter/lab/browser_test/chrome-test.js:55
  throw up;
  ^
true
(Use `node --trace-uncaught ...` to show where the exception was thrown)
[C 2021-02-25 17:18:03.685 ServerApp] Caught exception during the test:
Caught exception during the test:
[E 2021-02-25 17:18:03.685 ServerApp] ['node', 'chrome-test.js', 'file:///Users/mhilmy/Library/Jupyter/runtime/jpserver-2836-open.html'] exited with 1
['node', 'chrome-test.js', 'file:///Users/mhilmy/Library/Jupyter/runtime/jpserver-2836-open.html'] exited with 1
[I 2021-02-25 17:18:03.685 ServerApp] Test Complete
[C 2021-02-25 17:18:03.685 ServerApp] Exiting with 1 due to errors

I'm not sure why, maybe you have an experience with this? @diocas

Okay never mind, after I fixed the config files to match Lab3 migration guide the problem went away.

bari12 commented 3 years ago

👍

didithilmy commented 3 years ago

Great! I'll merge this to master. The Docker image should update to the latest Lab version as well.