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

Support for declaring extensions as peer dependencies #11808

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

tortmayr
Copy link
Contributor

What it does

Ensures that the ExtensionPackageCollector also correctly picks up packages that are declared as peer dependencies.

This change allows extension providers to declare their dependencies to Theia core extensions as peer dependencies. This can simplify version management and eliminates the need for yarn resolutions (or a similar feature) to ensure that only one version of Theia extensions is resolved.

This topics has already been discussed multiple times:

The question whether we actually want to change inter dependencies between Theia core packages to peer dependencies is still up for discussion.
Nevertheless, ensuring the the application builder also supports and correctly loads Theia extensions that are declared as peer dependencies is a good idea.

This is an opt-in feature that does not break any existing applications and gives third party extension providers the opportunity to use peer dependencies if they want to.

Contributed on behalf of STMicroelectronics

How to test

Can for instance be tested with the "@theia/api-samples" package by simply switching all dependencies to peerDependencies:

- "dependencies": {
+ "peerDependencies": {
    "@theia/core": "1.30.0",
    "@theia/file-search": "1.30.0",
    "@theia/filesystem": "1.30.0",
    "@theia/monaco": "1.30.0",
    "@theia/monaco-editor-core": "1.67.2",
    "@theia/output": "1.30.0",
    "@theia/search-in-workspace": "1.30.0",
    "@theia/toolbar": "1.30.0",
    "@theia/vsx-registry": "1.30.0",
    "@theia/workspace": "1.30.0"
  },
  1. Building this change on master results in a corrupt application. I.e. the browser application no longer loads and the following error is logged:
    Screenshot from 2022-10-27 18-15-20
    In the generated frontend index.js file you can see that the api-samples frontend module gets loaded before the required core modules which causes the error.

  2. Building this change on the PR branch causes no errors. The browser application loads as expected and the module loading is in correct order.

Review checklist

Reminder for reviewers

@vince-fugnitto vince-fugnitto added the dependencies pull requests that update a dependency file label Oct 28, 2022
Ensures that the ExtensionPackageCollector also correctly picks up theia extensions that are declared as peerDependencies.

Contributed on behalf of STMicroelectronics
@tortmayr tortmayr requested review from msujew and removed request for paul-marechal November 15, 2022 13:45
@JonasHelming
Copy link
Contributor

@msujew Could you do a re review? Would be great to have this in the December release (candidate for the community release)

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me 👍

I would like a second opinion on that though, @paul-marechal WDYT?

Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple enough, looks good to me.

@msujew msujew merged commit 2ec7d87 into eclipse-theia:master Nov 28, 2022
@vince-fugnitto vince-fugnitto added this to the 1.33.0 milestone Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants