-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Electron] Use absolute path for plugins running in Electron. #7202
[Electron] Use absolute path for plugins running in Electron. #7202
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @Johannes-B-stock!
Please be sure to sign the Eclipse ECA so we can accept your changes.
596e27a
to
1cae0ae
Compare
1cae0ae
to
dc804c0
Compare
fa172db
to
30c2a61
Compare
We added a fix for sidebar icons ( Regarding the ECA: I already created a private Eclipse account previously. Is there any way to add my work email to that or should I create a new work Eclipse account in order to sign the ECA? |
Would it be possible to squash the pull-request? (it'd also make it easier to handle the ECA) For the Eclipse ECA, it requires that your |
221fcda
to
d75efc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes eclipse-theia#7040. Signed-off-by: Johannes Birkenstock <johannes.birkenstock@siemens.com> Signed-off-by: Liwen Guo <liwen.guo@siemens.com>
d75efc3
to
7a25879
Compare
Done.
Thanks for the info. Actually noticed it only takes the commit author anyway so since I am only committer now I don't need to sign it. Yay 🎉 |
@vince-fugnitto Sure, nothing changed since #7202 (review) except that the commits have been squashed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull-request correctly fixed #7040.
@akosyakov did you have any objections with the following changes?
It looks good to me, wonder whether we still need |
Will merge tomorrow if there are no objections. |
@vince-fugnitto It would be better if someone from RedHat have a look cc @benoitf @azatsarynnyy Another thing it can be that some products expect that |
@@ -58,7 +60,7 @@ export interface PluginPackage { | |||
} | |||
export namespace PluginPackage { | |||
export function toPluginUrl(pck: PluginPackage, relativePath: string): string { | |||
return `hostedPlugin/${getPluginId(pck)}/${encodeURIComponent(relativePath)}`; | |||
return URI.file(pck.packagePath + '/' + relativePath).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we do here instead file?${URI.file(pck.packagePath + '/' + relativePath).toString()}
to avoid breaking all clients
That's actually a minimal not breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, i think we should revert changes and only update clients to something like:
new Endpoint({ path: iconUrl }).getRestUrl().toString()
It won't break anyone and fix clients in this repo.
// Se we look into the `process.env` as well. `is-electron` does not do it for us. | ||
return isElectron() || typeof process !== 'undefined' && typeof process.env === 'object' && !!process.env.THEIA_ELECTRON_VERSION; | ||
// So we look into the `process.env` as well. `is-electron` does not do it for us. | ||
return isElectron() || typeof process !== 'undefined' && typeof process.env === 'object' && (!!process.env.THEIA_ELECTRON_VERSION || !!process.env.ELECTRON_RUN_AS_NODE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how this change related to a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was used for the previous fix where toPluginUrl
would return a different value depending on whether it was running in Electron or not. ELECTRON_RUN_AS_NODE
covers the VS Code extension process.
So it's not necessary anymore, but it might still be an improvement (or break other things, or both, or neither). I'd keep the typo fix at least though ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just making sure that it does not get merged without doing #7202 (comment) to avoid breaking changes
I am looking for a fix for some issues fixed by this pull while sticking with |
The minimal solution is #7202 (comment). Someone has to update this PR or send a new PR. |
I'll test it out. There are some other things needing a small fix but I've noted them and will test everything. The last time I've created an endpoint inside plugin-protocol.ts it failed because window.location was not accessible and thus the browser Version was then broken. I'll test it with a clean new repository and if it fails again I'll divide the browser and electron return-statements. If it passes all my tests I'll create a new pull request to get it fixed as quickly as possible. Is there a deadline for which commits will reach the next release? |
I've created a pull request: #7583 to fix the there described issues. The PR is continuing the |
Closing in favor of #7583 |
Signed-off-by: Johannes Birkenstock johannes.birkenstock@siemens.com
What it does
Fixes #7040
It fixes this bug by using absolute paths for plugins that are running in Electron.
How to test
Run any vscode extension that uses its own images in the theia electron app.
Review checklist
Reminder for reviewers