Excluding single commit in package

The new multi-part file-upload is causing issues with my cloud proxies. I’m not sure what the issue is yet, I cant reproduce it locally. So I need to deploy a custom version of the filesystem package.

What’s the development flow for linking to a customize package in the theia repository?

I get all sorts of errors if I try to pull the package individually into my yarn workspace, so seems like it would be best to compile in tree. Do I include the entire theia repo in my yarn workspace? How do others do it?

@shortwavedave thank you for the discussion, you would/should create a custom extension that overrides and/or extends functionality provided by @theia/filesystem to suit your needs and use-cases.

To get started you can use the theia-extension-generator: https://github.com/eclipse-theia/generator-theia-extension.

There is no need to pull the theia monorepo as part of your setup or yarn workspace.

1 Like

Thanks for the reply @vince-fugnitto. Oh I see. I was hoping to simply revert the single commit and keep everything else. With a custom extension I would need to copy all the old code, no? or edit the current implementation and add debugging

Oh I see. I was hoping to simply revert the single commit and keep everything else.

@shortwavedave you might want to try adding the extension locally, modify it and referencing it as a local path:

You would update @theia/filesystem to point to your local version in your application, at least something to try :slight_smile:

With a custom extension I would need to copy all the old code, no?

You would modify the method(s) that need modifications and rebind the component to yours (dependency injection). If its too much of an overhead you might try the local path.

1 Like

hey @vince-fugnitto, having a little trouble with the rebinding pattern (I tried the local file and was getting errors related to a failed rebind of the breadcrumb contribution, gah).

I created an new extension called file-upload with a file-upload-service.ts that looks like this:

import {FileUploadService as OgFileUploadService} from "@theia/filesystem/lib/browser/file-upload-service"

@injectable()
export class FileUploadService extends OgFileUploadService{

}

Then in the frontend module I have this:

import { ContainerModule } from 'inversify';
import {FileUploadService} from "./file-upload-service";
import {FileUploadService as OgFileUploadService} from "@theia/filesystem/lib/browser/file-upload-service"

export default new ContainerModule((bind, unbind, isBound, rebind) => {
    if (isBound(OgFileUploadService)) {
        bind(FileUploadService).toSelf().inSingletonScope()
        rebind(OgFileUploadService).toService(FileUploadService)
    }
});

I was hoping this would succeed without error, but what I get are a number of errors in the browser like so:

TypeError: class constructors must be invoked with 'new'  -- [contribution-provider.ts:50:32](webpack:///node_modules/@theia/core/src/common/contribution-provider.ts?)

Child node 'file-change-tree-root' does not belong to this 'file-change-tree-root' tree.
Child node 'open-editors:root' does not belong to this 'open-editors:root' tree.
...

I think I am misusing inversify, which happens often. Any suggestions?

Apparently I had a target of “es5” in the tsconfig file. If I change it to “target”: “ES2017”, then the browser starts up without those type errors. The child node errors are still present, but doesn’t appear to be affecting the functionality