Skip to content

Update to JupyterLab 4 #40

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Update to JupyterLab 4 #40

wants to merge 5 commits into from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 4, 2025

This PR migrates the jupyterlab-plugin-graph extension to support JupyterLab 4.x, addressing the deprecation of private APIs and updating all dependencies.

Changes Made

🎯 Core Migration

  • Updated dependencies: All JupyterLab packages upgraded from 3.x to 4.x
  • API Migration: Replaced deprecated app['_pluginMap'] with hybrid approach using public Lumino APIs
  • Plugin Access: Created createPluginsMap() function that:
    • Uses public APIs (listPlugins(), getPluginDescription(), isPluginActivated())
    • Falls back to private _pluginMap for full metadata (requires, optional, provides)
    • Gracefully handles errors if private API access fails

🔧 Technical Improvements

  • TypeScript Configuration:
    • Updated target to es2018 and added proper lib configuration
    • Added skipLibCheck: true to resolve dependency type conflicts
  • React Compatibility: Updated React types from v17 to v18
  • Build System: Replaced jlpm with yarn for consistency
  • Code Quality: Fixed ESLint/Prettier formatting issues
  • Cytoscape Fix: Removed invalid padding-bottom style property

📦 Version & Documentation

  • Version Bump: Updated to 0.3.0 to reflect major compatibility change
  • Requirements: Updated README to specify JupyterLab >= 4.0 (was >= 2.0)
  • Changelog: Added comprehensive migration notes

✅ Testing & Validation

  • TypeScript compilation passes without errors
  • Extension builds successfully (both lib and labextension)
  • Plugin metadata extraction validated with unit tests
  • ESLint checks pass
  • No runtime errors in generated JavaScript

Migration Strategy

The extension maintains functionality by using a hybrid approach:

  1. Public APIs First: Attempts to use official Lumino APIs when available
  2. Graceful Fallback: Falls back to private _pluginMap for complete plugin metadata
  3. Error Handling: Gracefully degrades if private API access fails

This ensures compatibility with JupyterLab 4.x while maintaining full functionality until official APIs are available for plugin metadata access.

Breaking Changes

⚠️ Minimum JupyterLab version is now 4.0 (previously 2.0)

Fixes #39.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits July 4, 2025 15:03
Co-authored-by: jtpio <591645+jtpio@users.noreply.github.com>
Co-authored-by: jtpio <591645+jtpio@users.noreply.github.com>
Co-authored-by: jtpio <591645+jtpio@users.noreply.github.com>
Co-authored-by: jtpio <591645+jtpio@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Update to JupyterLab 4 Update to JupyterLab 4 Jul 4, 2025
@Copilot Copilot AI requested a review from jtpio July 4, 2025 15:17
Copilot finished work on behalf of jtpio July 4, 2025 15:17
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.

Update to JupyterLab 4
2 participants