-
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
Fix: Plugins folders are created with exclamation mark, which breaks webpack #7799
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.
@shahar-h thank you for the contribution, please take care to squash commits and ensure that they are properly signed (reason for the failed CI check). I'm not sure I understand the use-case, but I do not believe it is common/advised to export plugins in such as way that was described in the pull-request's description.
@vince-fugnitto Could you please finish the review and merge if when you think it is good, thank you! |
…s webpack sign commit Signed-off-by: Shahar Harari <[email protected]> sign commit Signed-off-by: Shahar Harari <[email protected]>
The use case is using
It's just an easy way to test. The described behavior is also reproduced when deploying a plugin with |
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 verified using the 'steps to reproduce' and it looks like underscore works fine as a replacement.
I also took the time to verify the 'steps to reproduce' on master
and it works correctly for me as well. If there is a bug I'm not sure how to reproduce it, or the 'steps to reproduce' might not be descriptive enough to highlight the buggy behavior.
Nitpick: the commit message is not formatted properly:
@vince-fugnitto I can try to create a sample vs code extension in order to show the buggy behavior. |
I trust you :) |
I'll give it some time for others to get a chance to review if they like, and merge if there are no objections. |
@vince-fugnitto Can this be merged or we are still waiting for feedback? |
@vince-fugnitto please help to merge if you think it is good |
I did want others to look but to me |
What it does
Currently when loading Theia plugin / VS code extension, illegal characters are replaced with
!
on plugin folder creation. This is done because filenamify library is used to create legal folder names for plugins, and!
is the default replacement character.i.e.: Loading theia with the following vsix:
https://github.com/streetsidesoftware/vscode-spell-checker/releases/download/v1.9.0-alpha.1/code-spell-checker-1.9.0-alpha.1.vsix
will cause
https!github.com!streetsidesoftware!vscode-spell-checker!releases!download!v1.9.0-alpha.1!code-spell-checker-1.9.0-alpha.1.vsix
folder to be created.In case webpack is used in runtime by some extension it will break because
!
is reserved for webpack loaders mechanism.See:
webpack/webpack#6742
https://github.com/byzyk/webpack/blob/master/schemas/ajv.absolutePath.js#L38
In order to fix this issue
_
is passed as a replacement character tofilenamify
instead of the default!
.How to test
Load Theia with both VS Code extension and Theia plugin from URL:
https_github.com_streetsidesoftware_vscode-spell-checker_releases_download_v1.9.0-alpha.1_code-spell
folder should be created undervscode-unpacked
folder.https_github.com_redhat-developer_netcoredbg-theia-plugin_releases_download_v0.0.3_netcoredbg_theia_
folder should be created undertheia-unpacked
folder.VS Code extension should be activated:
Theia plugin should be activated:
Review checklist
Reminder for reviewers
Signed-off-by: Shahar Harari [email protected]