chore: use shared packages in src-gen #15185
Open
+4
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
Src-gen is executed in the environment controlled by adopters. In the generated code dependencies are imported. If these dependencies are not located where webpack expects them, the adopter will experience build errors. This is not a common case, but it does happen in practice.
The generated code is made more robust by reusing the shared core dependencies where applicable. As it's common to declare '@theia/core' as a dependency within the adopter package, this more commonly results in a working build.
Contributed on behalf of STMicroelectronics
How to test
Make sure example applications continue working
Follow-ups
This PR only adjusts imports which are already exported by
@theia/core
. This already improves the issue in real world use cases in which these packages were the affected ones in build errors.For a more complete solution we should:
@theia/core
which are used in src-gen, or,Breaking changes
Attribution
Contributed on behalf of STMicroelectronics
Review checklist
Reminder for reviewers