Problem to watch changes when developing extensions

Does anyone know what are the possible reasons why I have to build theia from root everytime I want to test the code on the browser during development?

I am developing a custom extension (frontend contribuition) and besides building the specific package I need to build and restart Theia from root.

I’ve tried to use “yarn watch” but it makes no difference, any thoughts will be appreciated, thanks!

[original thread by jvsoares]

@jvsoares what exactly does your repository look like? Does your custom extension come from the yeoman generator? Generally, you should watch for changes in your extension, watch the browser example, and start the example (I do this in three terminal tabs).

It should not be necessary. A custom extension should be set up with https://theia-ide.org/docs/authoring_extensions/ After that look at generated README.md it explains incremental development and it does not require running yarn in the root each time.

[Hanksha]

I personally use lerna run --parallel watch to watch all the extensions. (with optionally –ignore electron-app) then start the browser backend.

[jvsoares]

@hanksha which command do you use to start the browser backend?

[jvsoares]

Thanks @anton-kosyakov , I will try to create a new extension from scratch and see how it goes

[Hanksha]

cd browser-app then yarn start. If you’re using VS Code there is a provided launch config for it when you generated the project with yeoman.

I am developing a custom extension (frontend contribuition) and besides building the specific package I need to build and restart Theia from root.

A Theia application is built in two steps: 1) you transpile TypeScript to Javascript. 2) you bundle frontend code using webpack.

It is possible to run a watcher with webpack, but for some reason it doesn’t work for me anymore. But what you can do instead of rebuilding everything from the root would be to build your package, and then rebundle the app before running it. If your changes are not in the bundle you won’t see them at runtime.