eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.29k stars 2.45k forks source link

Use relative paths for ctx.importScripts() #13854

Closed sgraband closed 1 day ago

sgraband commented 1 week ago

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