-
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
6601 load plugin manifest #8485
6601 load plugin manifest #8485
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.
I get an error when running the vscode ext you suggested:
root ERROR Could not transfer 'package.nls.json' file from 'che__eclipse_che_hello_world_frontend_plugin' Error: ENOENT: no such file or directory, stat 'c:\Users\me\AppData\Local\Temp\theia-unpacked\eclipse_che_hello_world_frontend_plugin.theia\package.nls.json'
The ext is indeed missing a package.nls.json
file. Is it a mandatory file?
readPluginJson(pluginModel, 'package.json'), | ||
loadTranslations(pluginModel) | ||
]); | ||
// translate vscode builtins, as they are published with a prefix. See https://github.com/theia-ide/vscode-builtin-extensions/blob/master/src/republish.js#L50 |
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 link is dead.
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.
Copy paste from the other "plugin-manifest-loader.ts". No Idea where that is coming from.
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.
@akosyakov any idea what the correct link might be here?
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.
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.
Since we can't seem to find the proper uri I've removed the link.
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.
|
||
function readContents(uri: string): Promise<string> { | ||
return new Promise((resolve, reject) => { | ||
const request = new XMLHttpRequest(); |
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.
Any reason why using XHR instead of the newer fetch API
?
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.
If all you know is a hammer ;-) No, there's no reason.
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.
I'd prefer using fetch
, but I'll leave it up to you since ultimately it works.
I think it's not handling the case where a file could be optional as package.nls.json may be missing |
No, the error should be handled up the call chain, though. |
@marechal-p are you using electron? The description states that I have no idea how to compute the URI in this case:
If you have any suggestions, I'm all ears. Otherwise, since front-end plugins don't work at all, I think we should still merge the PR, it makes front-end plugins at least work in the browser case. |
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.
@tsmaeder I was convinced I had tried on the browser version, but you might be right. Tested again using browser and it works well. Electron does not.
LGTM.
packages/plugin-ext/src/hosted/browser/worker/plugin-manifest-loader.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Thomas Mäder <tmader@redhat.com>
7134444
to
622d5cf
Compare
@tsmaeder you can restart the build if you like, sometimes we clear the Travis |
I tried restarting the build, but it had no effect. Where do I click? |
I don't get the "rerun" buttons in the rightmost columns. Who do I need to bribe? |
I'm not sure :) @marcdumais-work maybe you know about how to give rights to maintainers for Travis? |
Now some other test fails and one of the platforms being tested actually passes. This is frustrating! |
Also, locally on Windows, I get another test failure (pre-hook for "move file" fails). Are the tests expected to be flaky? |
You should normally be permitted to do this, since you have write-access to the repo. Can you access to the following? https://travis-ci.com/github/eclipse-theia/theia/settings |
I rebuilt, it previously failed since |
loadTranslations(pluginModel) | ||
]); | ||
// translate vscode builtins, as they are published with a prefix. | ||
const built_prefix = '@theia/vscode-builtin-'; |
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.
This is to support using vscode built-ins from npm
I think? Do you still use these in Che?
We have a couple of fixes, to work-around problems with specific built-ins during vsix packaging - I do not think we do the same with the npm
version.
There is also some extra massaging done to each built-in's package.json
, e.g. to make NLS work
Is this the case that because of the nature of this extension (it's Che-related after all), it's expected not to work on the Electron version of a Theia app? |
@marcdumais-work more like that in a perfect world frontend extensions should work in any Theia product, but it was broken for both browser and electron contexts. This PR only fixes the browser part (I tested on the example apps), and I don't know how to fix Electron either so hence why I am happy with the current changes. |
No, I get "Your permissions are insufficient". |
I am not sure what the problem might be - the only hits on Google search seem to be CI for repos that their crawler was enable to access, giving this same error. One thing worth a try: On the following page, click on "sync account", on the upper left quadrant of the page: Do you see the "eclipse-theia" organization listed, under the button? |
What it does
Fixes "Frontend plugins are broken" #6601 by loading the package.json upon initializing the plugin.
Note: I haven't been able to make the electron case work, since I don't know how to compute the proper URI to load package.json. However, since I'm going to be on vacation, I wanted to propose this PR anyway...maybe someone can fix it.
How to test
Build a front end plugin (for example https://github.com/eclipse/che-theia-samples/tree/master/samples/hello-world-frontend-plugin) and add the resulting plugin to the theia plugins folder.
Start Theia and ensure that the "Hello World" command has been added via
F1
.Review checklist
Reminder for reviewers