How to develop for Inspector

I found the packages/dev/inspector/package.json, run the npm run watch and what’s next? I should to open localhost? Which is the port?

Also I found the packages/dev/inspector/README.md and instruction:

Contribute

From the tools/gulp folder:

npm install
gulp inspector

But I do not found the tools/gulp folder in the repo, where is it? There are packages/tools/ but without gulp inside.

1 Like

These instructions are outdated, sorry about that :sweat_smile: You can follow the instructions on Start Contributing to Babylon.js | Babylon.js Documentation (babylonjs.com) instead to build and to see the inspector, it’s better to use the “dev host” or “playground” tasks: Start Contributing to Babylon.js | Babylon.js Documentation (babylonjs.com)

EDIT: Did a quick PR just to update the inspector readme update inspector readme by carolhmj · Pull Request #13714 · BabylonJS/Babylon.js (github.com)

5 Likes

@carolhmj thank a lot!

So, it’s nice longtext, but in fact all I need to work with Inspector is:

npm ci
npm run serve -w @tools/dev-host

And open http://localhost:1338/

@carolhmj sorry, I still doesnt complete understend.
I run npm run serve -w @tools/dev-host and now when I change the code in the packages/tools/devHost/src/createScene.ts the serve mode successfully rebuild current version and refresh the page in the browser. But when I make some changes in the packages/dev/inspector/src/components/sceneExplorer/sceneExplorerComponent.tsx the Inpsector not rebuilded automatically. An even after manually page refresh the scripts still in the old version. Probably I miss some command? How to work with the Inspector’s code?

Sorry, I really missed the npm run serve -w @tools/dev-host

So, I should run two terminals? One for npm run serve -w @tools/dev-host and second for npm run serve -w @tools/dev-host, is it proper way?

cc @RaananW who can detail more when he ll be back from vacations.

1 Like

I think to do it manually you have to run the “Watch” tasks too: npx build-tools -c dw -wa, and the serve.

The dev-host is meant as an es6-playground for the packages, importing directly from the packages. It should compile changes if in watch mode. I am actually in the process of improving it this/next week, so i’ll follow up and fix any issue I find. then it’ll be more stable (and better documented).

A simpler way to get everything compiled for you is to use the babylon-server - npm run serve -w @tools/babylon-server , which will make sure to listen to changes on all served packages, including the inspector. You have a few code samples in the babylon-server directory, and you can also load snippets, similar to the way the playground is working. Does that help you move forward?

2 Likes