You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we need to do two simple patches in PhosphorJS in order for "secondary window" support to work. However, various fixes in secondary windows support require more extensive fixes in PhosphorJS.
The mechanism we use up to now for patching Phosphor is based on the string-replace-loader webpack plugin: we search and replace strings when doing the webpack-build of the front end. This has a couple of problems:
It does not work in cases where adopters do not want to use webpack
It does not work if the interface of the library is patched, because webpack is invoked after compilation of Typescript files
It is very hard to manually write and maintain the string replacements, aka it just does not scale.
In https://github.com/eclipse-theia/theia/pull/13493/files, I'm proposing a way to use patch-package to apply patches to Theia dependencies. However, this approach requires adopters to invoke the script theia-patch in directory where their node_modules folder is located. We can't really fully automate this, since npm modules may be linked into the node_modules folder, so we can't really determine the root node_modules folder from a script inside the package contents, using for example a postInstall or precompile' script on the Theia core package. One way to solve this problem would be to write our own script that uses require.resolve()` to find the installation location of the packages we would like to patch and the patch files themselves instead of relying on the file system. However, this would be a non-trivial effort, maybe a couple of days.
The text was updated successfully, but these errors were encountered:
Feature Description:
Currently, we need to do two simple patches in PhosphorJS in order for "secondary window" support to work. However, various fixes in secondary windows support require more extensive fixes in PhosphorJS.
The mechanism we use up to now for patching Phosphor is based on the
string-replace-loader
webpack plugin: we search and replace strings when doing the webpack-build of the front end. This has a couple of problems:In https://github.com/eclipse-theia/theia/pull/13493/files, I'm proposing a way to use
patch-package
to apply patches to Theia dependencies. However, this approach requires adopters to invoke the scripttheia-patch
in directory where theirnode_modules
folder is located. We can't really fully automate this, since npm modules may be linked into thenode_modules
folder, so we can't really determine the root node_modules folder from a script inside the package contents, using for example apostInstall
orprecompile' script on the Theia core package. One way to solve this problem would be to write our own script that uses
require.resolve()` to find the installation location of the packages we would like to patch and the patch files themselves instead of relying on the file system. However, this would be a non-trivial effort, maybe a couple of days.The text was updated successfully, but these errors were encountered: