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

[WIP] JupyterLab 4.x upgrade #25

Merged
merged 77 commits into from
Sep 10, 2024

Conversation

paulovmr
Copy link

What changes were proposed in this pull request?

This PR is based on the Elyra community effort (elyra-ai#3201 and lresende#1) to migrate Elyra extensions to support JupyterLab 4.x, with the addition of more changes, such as:

  • Removed trailing commas to facilitate the diff visualization
  • Removed fixed Yarn path
  • Removed duplicated files
  • [...] WIP to be continued...

How was this pull request tested?

This is a work in progress.

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

lresende and others added 29 commits August 30, 2024 10:29
Signed-off-by: Luciano Resende <[email protected]>
Signed-off-by: Luciano Resende <[email protected]>
Signed-off-by: Luciano Resende <[email protected]>
Signed-off-by: Luciano Resende <[email protected]>
Updated LauncherModel to accommodate changes in @lumino/algorithm. Resolved build errors related to missing properties and import issues.
Resolved type errors related to missing children property in Dropzone.tsx, ExpandableComponent.tsx, and ExpandableErrorDialog.tsx. Fixed import issues in FormEditor.tsx by addressing missing members and correcting import statements. Improved TypeScript type inference and resolved implicit 'any' types in parameters and binding elements in JSONComponent.tsx.
TypeScript Error: Incompatibility
Component Structure: Clarification
Prop Types: Consistency and Definition
Unable to find the documentation regarding changes that made the types unavailable, and defined new types base on available specifications in 3.6x.

`Property 'IConfig' does not exist on type 'typeof CodeEditor'.ts(2339)`
`Namespace '.../node_modules/@jupyterlab/codeeditor/lib/editor".CodeEditor' has no exported member 'IConfig'.ts(2694)`
Note:
to compile python editor, build script editor first
Updated CodeBlock to uses updated version of CodeEditor.
Changed the implementation base on the source code for IOptions:
https://github.com/jupyterlab/jupyterlab/blob/d274f84/packages/codeeditor/src/editor.ts#L553
fixed type errors for TagsField
Changed IFormComponentRegistry in metadata and meta-data common to use IFormRendererRegistry for 4.x.
Updated Scala editor to be compatible with 4.x. The code used to use IConfig which is no longer in use. But config options is now currently under IOptions. But we need to see if It displays properly on frontend. But the code currently builds.
The fields prop was removed from FieldTemplateProps in a recent update. Resolved the integration by passing a templates object to the fields prop. Also added validator, which is now a required prop for 5.x Form. But still need to work on resolving precise type configurations.

src: https://rjsf-team.github.io/react-jsonschema-form/docs/migration-guides/v5.x%20upgrade%20guide#rjsfcore-breaking-changes
Because involved react component and does not directly conform to the IFormRenderer interface use assertion to satisfy the type requirements of the addRenderer method. Also improve types definition for imported component in ui-components. Now able to build metadata.
I have resolved most of the errors currently in the pipeline editor however I got stuck attempting to fix the error:  error TS2322: Type '{ children: Element[]; theme: any; }' is not assignable to type 'IntrinsicAttributes & { theme: DeepPartial<Theme>; }'.
  Property 'children' does not exist on type 'IntrinsicAttributes & { theme: DeepPartial<Theme>; }'.
Updated CodeSnippetDisplay class to extend MetadataDisplay with the correct props type
Replace usage of deprecated ContentFactory, but still exist issue when missing documentation.
tried to fix the first code cell creation error, but still have issue when inserting cell to notebook widget
Just figured out how to properly add codecell.
Fixed some method calling base on documentation.
- .value.text does not work for updating the content of Cell, Replaced with .setSource.
- Refresh no longer exists, replaced with redo. Can't find any documentation about this change.
- fixed creation of preview editor
Resolved final error in pipeline editor. Now it's able to build.
This reverts commit ac10f57.
@paulovmr
Copy link
Author

Merging this to the opendatahub-io/jupyterlab4 branch to continue the work there.

@paulovmr paulovmr merged commit 9cb2e21 into opendatahub-io:jupyterlab4 Sep 10, 2024
15 of 16 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.

6 participants