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

Use relative paths for ctx.importScripts() #13854

Merged

Conversation

sgraband
Copy link
Contributor

What it does

Before we tried to load absolute paths e.g. /context/. This is a problem, when working in deployed use cases, where Theia might be hosted under a path (e.g. try.theia-cloud.io). Because then the loaded path will be from the root of the page and not, like wanted, from the current path. Simply changing it to relative paths (e.g. ./context/) solves this issue.

Fixes #13813

How to test

This will be hard to test, as you would need a deployment where Theia is hosted under a path (e.g. try.theia-cloud.io) and this fix is applied. As far as i am aware there is no easy way to run theia under a path locally.
However, it could be tested, that this does not break something for the example applications.

To test simply install a frontend vscode extension and observe that the console throws no error and that the files are loaded from the correct location.

Follow-ups

Review checklist

Reminder for reviewers

Before we tried to load absolute paths e.g. `/context/`.
This is a problem, when working in deployed use cases, where Theia might be hosted under a path (e.g. try.theia-cloud.io).
Because then the loaded path will be from the root of the page and not, like wanted, from the current path.
Simply changing it to relative paths (e.g. `./context/`) solves this issue.

Fixes eclipse-theia#13813
@JonasHelming JonasHelming requested a review from msujew July 2, 2024 11:58
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.

Looks good to me. I couldn't test everything, but the existing behavior is still correct, so I assume this still works as expected when Theia is deployed under a path.

@msujew msujew added the vscode issues related to VSCode compatibility label Jul 3, 2024
@JonasHelming JonasHelming merged commit 69b8877 into eclipse-theia:master Jul 3, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Correctly load frontend plugins when deployed under a path
3 participants