Jump to content

Contributing on Babylon.js


Nockawa
 Share

Recommended Posts

Hello guys,

I'm really not a Web/OSS dev, I know 3D and programming, but I have to admit that I struggle to find a "decent" setup to contribute to babylon.js.

What I propose is to gather the best practices on this thread and I will make a documentation on the Github project to avoid unnecessary future "me" struggling in the dark. I read other topics, but they focus mainly on setup/building, what I can't get working decently is the editing/dev experience.

I think I got the Git/Fork/NPM part ok, I can build Babylon.js using gulp.

But, using VSCode or Visual Studio I really can't find a way to contribute to the project.

  • VSCode shoots me some undefined types error, I don't know why. I don't know if I'm supposed to open VSCode on the babylon.js root directory or in the \src one. In any case I just can't have .ts file not complaining each time I open one.
  • Visual Studio, well, from what I can tell the project is not setup to work with Visual Studio, I tried to tweak few things, but again, unsuccessfully.

What I would like to achieve is a good dev experience, contributing on the lib and testing my changes right away in a local sandboxed example.

A good start would be to write a guide for VSCode I guess but any other suggestions are welcomed.

Thanks for your help

 

 

Link to comment
Share on other sites

Hi Nockawa,

Thanks a lot for thinking about contributions! They will surely help the entire community.

VSCode is a wonderful editor. but it is one of many. We just added a tsconfig file to the src directory, so typescript will work in VScode (and other IDEs natively supporting typescript).

But VSCode is just one editor of many. You can use a text editor, and watching your changes using gulp (run the task "watch-typescript"). 

Using Visual Studio will require to set the project correctly. I think using Visual Studio just for TypeScript is a bit too much, but this is a personal opinion. 

This is the way I am working - 

Open the src folder of Babylon in VSCode. This will get your autocomplete working, and will show you errors without compiling.

After I made the changes, i run gulp typescript and see that it was compiled correctly. I then use the generated max js file on a different project (also in VSCode, but this is a different story). I personally don't like all of those watchers (with typescript), because I use the auto-save feature. Which will constantly compile the project with every little change I make. But again, this is a personal opinion :)

Main thing - do whatever you feel comfortable with. Webstorm/IntelliJ Idea has a wonderful TypeScript support. Eclipse as well (as far as I know, I never used eclipse for that). Atom has support. Hell, you can even use VI if it makes you happy ;)

Looking forward to your PRs!

Link to comment
Share on other sites

I'm using Atom with the TS support under linux ubuntu 14.

Like Raanan, I don't use the auto-saver-compiler, but just the in-line command "gulp typescript" to compile everything (between 12 and 15" on my computer).

I directly open the Babylon.js folder and everything works (if not, just type "create tsconfig file" in the Atom command palette and that's it) : autocompletion, errors, etc.

I tested several editors  for BJS with TS (I avoided quickly all the big IDEs) : Webstorm, Gedit, Scite, SublimeText2, VSCode and Atom. I find the two best for TS and this framework (personal opinion) are VSCode and Atom what are quite similar in term of ergonomy and features (even in term of architecture under the hood).

I just kept Atom because it has the Cobalt theme that I like a lot and because it has an integrated package manager and a software auto-updater (couldn't find the auto-updater in the VSCode for Linux)  

Link to comment
Share on other sites

10 hours ago, RaananW said:

Hi Nockawa,

Thanks a lot for thinking about contributions! They will surely help the entire community.

VSCode is a wonderful editor. but it is one of many. We just added a tsconfig file to the src directory, so typescript will work in VScode (and other IDEs natively supporting typescript).

But VSCode is just one editor of many. You can use a text editor, and watching your changes using gulp (run the task "watch-typescript"). 

Using Visual Studio will require to set the project correctly. I think using Visual Studio just for TypeScript is a bit too much, but this is a personal opinion. 

This is the way I am working - 

Open the src folder of Babylon in VSCode. This will get your autocomplete working, and will show you errors without compiling.

After I made the changes, i run gulp typescript and see that it was compiled correctly. I then use the generated max js file on a different project (also in VSCode, but this is a different story). I personally don't like all of those watchers (with typescript), because I use the auto-save feature. Which will constantly compile the project with every little change I make. But again, this is a personal opinion :)

Main thing - do whatever you feel comfortable with. Webstorm/IntelliJ Idea has a wonderful TypeScript support. Eclipse as well (as far as I know, I never used eclipse for that). Atom has support. Hell, you can even use VI if it makes you happy ;)

Looking forward to your PRs!

Thanks for the answer RaananW, well, I could manage to build using VSCode using Gulp manually in a command line, but I would have like to get the TaskRunner running in order to get the error output windows in VSCode working and redirect me to the faulted lines. I wasn't able to setup the TaskRunner correctly, I set  a gulp command with the args trying to specify the gulpfiles.js in \Tools\Gulp, but VSCode keeps telling me it doesn't find this config file... I don't want to mess up the file structure of the repo in order to make simple/harmless pull requests.

Maybe I have to lower my expectations, but getting and error output working really is something I think is helpful when you make big changes.

All in all, I still favor Visual Studio because I'm used to it and the debugger is working with TypeScript, I could not go that far with VSCode but I'm willing to use it if it works for the basics stuffs.

It would be nice to gather info and create Guides about how to setup specific IDE to work with the lib, getting the basics (compile, error, intellisense, debug) working.

If someone succeed at configuring the Task Runner for VSCode that would be definitely be a good thing!

Link to comment
Share on other sites

  • 10 months later...

In the Babylon js readme.md file there are a couple links to how to setup:

"We have a general purpose documentation for you and a Visual Studio specific one"

But the "general purpose documentation for you" really assumes you will be using VSCode and compile using "CTRL-SHIFT-B". I'm currently using vi and command line but I'm fuzzy on how to "build" from the command line.

After some looking around it looks like I need to go into Tools/Gulp:

cd Tools/Gulp

Looking at the gulpfile.js file it appears there are 3 parameters I can use, 'default' (or nothing), 'typescript' or 'typescript-all'. So trying default/nothing I get the following:

$ gulp
[14:30:13] Using gulpfile ~/foss/Babylon/Babylon.js.my-fork/Tools/Gulp/gulpfile.js
[14:30:13] Starting 'default'...
[14:30:13] Starting 'includeShaders'...
[14:30:13] Finished 'includeShaders' after 9.76 ms
[14:30:13] Starting 'shaders'...
[14:30:13] Finished 'shaders' after 2.42 ms
[14:30:13] Starting 'buildNoWorker'...
[14:30:13] Tested 38 tests, 38 passes, 0 failures: PASS
[14:30:13] Tested 53 tests, 53 passes, 0 failures: PASS
[14:30:13] Tested 115 tests, 115 passes, 0 failures: PASS
[14:30:13] Tested 70 tests, 70 passes, 0 failures: PASS
[14:30:22] Finished 'buildNoWorker' after 9 s
[14:30:22] Starting 'workers'...
[14:30:22] Finished 'workers' after 1.88 ms
[14:30:22] Starting 'includeShaders'...
[14:30:22] Finished 'includeShaders' after 428 μs
[14:30:22] Starting 'shaders'...
[14:30:22] Finished 'shaders' after 367 μs
[14:30:22] Starting 'build'...
[14:30:22] Tested 5 tests, 5 passes, 0 failures: PASS
[14:30:23] Tested 38 tests, 38 passes, 0 failures: PASS
[14:30:23] Tested 53 tests, 53 passes, 0 failures: PASS
[14:30:23] Tested 115 tests, 115 passes, 0 failures: PASS
[14:30:23] Tested 70 tests, 70 passes, 0 failures: PASS
[14:30:31] Finished 'build' after 9.39 s
[14:30:31] Starting 'includeShaders'...
[14:30:31] Finished 'includeShaders' after 554 μs
[14:30:31] Starting 'shaders'...
[14:30:31] Finished 'shaders' after 321 μs
[14:30:31] Starting 'buildCore'...
[14:30:31] Tested 38 tests, 38 passes, 0 failures: PASS
[14:30:31] Tested 53 tests, 53 passes, 0 failures: PASS
[14:30:31] Tested 115 tests, 115 passes, 0 failures: PASS
[14:30:37] Finished 'buildCore' after 6.24 s
[14:30:37] Finished 'default' after 25 s

And then using git status we see default "modifies" 4 .js files:

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   ../../dist/preview release/babylon.core.js
    modified:   ../../dist/preview release/babylon.js
    modified:   ../../dist/preview release/babylon.max.js
    modified:   ../../dist/preview release/babylon.noworker.js

 

The next I try "typescript" and we see it executes 'typescript-compile' and then 'default':

$ gulp typescript
[14:35:00] Using gulpfile ~/foss/Babylon/Babylon.js.my-fork/Tools/Gulp/gulpfile.js
[14:35:00] Starting 'typescript'...
[14:35:00] Starting 'typescript-compile'...
[14:35:09] Finished 'typescript-compile' after 8.83 s
[14:35:09] Starting 'default'...
[14:35:09] Starting 'includeShaders'...
[14:35:09] Finished 'includeShaders' after 18 ms
[14:35:09] Starting 'shaders'...
[14:35:09] Finished 'shaders' after 5.7 ms
[14:35:09] Starting 'buildNoWorker'...
[14:35:09] Tested 38 tests, 38 passes, 0 failures: PASS
[14:35:09] Tested 53 tests, 53 passes, 0 failures: PASS
[14:35:09] Tested 115 tests, 115 passes, 0 failures: PASS
[14:35:09] Tested 70 tests, 70 passes, 0 failures: PASS
[14:35:19] Finished 'buildNoWorker' after 10 s
[14:35:19] Starting 'workers'...
[14:35:19] Finished 'workers' after 1.49 ms
[14:35:19] Starting 'includeShaders'...
[14:35:19] Finished 'includeShaders' after 429 μs
[14:35:19] Starting 'shaders'...
[14:35:19] Finished 'shaders' after 389 μs
[14:35:19] Starting 'build'...
[14:35:20] Tested 5 tests, 5 passes, 0 failures: PASS
[14:35:20] Tested 38 tests, 38 passes, 0 failures: PASS
[14:35:20] Tested 53 tests, 53 passes, 0 failures: PASS
[14:35:20] Tested 115 tests, 115 passes, 0 failures: PASS
[14:35:20] Tested 70 tests, 70 passes, 0 failures: PASS
[14:35:29] Finished 'build' after 10 s
[14:35:29] Starting 'includeShaders'...
[14:35:29] Finished 'includeShaders' after 1.97 ms
[14:35:29] Starting 'shaders'...
[14:35:29] Finished 'shaders' after 954 μs
[14:35:29] Starting 'buildCore'...
[14:35:29] Tested 38 tests, 38 passes, 0 failures: PASS
[14:35:29] Tested 53 tests, 53 passes, 0 failures: PASS
[14:35:30] Tested 115 tests, 115 passes, 0 failures: PASS
[14:35:35] Finished 'buildCore' after 6.16 s
[14:35:35] Finished 'default' after 27 s
[14:35:35] Finished 'typescript' after 36 s

 

And that add babylon.d.ts to the other 4 files from default:

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../../dist/preview release/babylon.core.js
	modified:   ../../dist/preview release/babylon.d.ts
	modified:   ../../dist/preview release/babylon.js
	modified:   ../../dist/preview release/babylon.max.js
	modified:   ../../dist/preview release/babylon.noworker.js

 

Finally, I tried 'typescript-all' and it adds the typescript-libraries to the list of tasks to run:

$ gulp typescript-all
[15:03:27] Using gulpfile ~/foss/Babylon/Babylon.js.my-fork/Tools/Gulp/gulpfile.js
[15:03:27] Starting 'typescript-all'...
[15:03:27] Starting 'typescript'...
[15:03:27] Starting 'typescript-compile'...
[15:03:36] Finished 'typescript-compile' after 8.87 s
[15:03:36] Starting 'default'...
[15:03:36] Starting 'includeShaders'...
[15:03:36] Finished 'includeShaders' after 18 ms
[15:03:36] Starting 'shaders'...
[15:03:36] Finished 'shaders' after 7.33 ms
[15:03:36] Starting 'buildNoWorker'...
[15:03:36] Tested 38 tests, 38 passes, 0 failures: PASS
[15:03:36] Tested 53 tests, 53 passes, 0 failures: PASS
[15:03:36] Tested 115 tests, 115 passes, 0 failures: PASS
[15:03:36] Tested 70 tests, 70 passes, 0 failures: PASS
[15:03:46] Finished 'buildNoWorker' after 11 s
[15:03:46] Starting 'workers'...
[15:03:46] Finished 'workers' after 1.44 ms
[15:03:46] Starting 'includeShaders'...
[15:03:46] Finished 'includeShaders' after 429 μs
[15:03:46] Starting 'shaders'...
[15:03:46] Finished 'shaders' after 390 μs
[15:03:46] Starting 'build'...
[15:03:47] Tested 5 tests, 5 passes, 0 failures: PASS
[15:03:47] Tested 38 tests, 38 passes, 0 failures: PASS
[15:03:48] Tested 53 tests, 53 passes, 0 failures: PASS
[15:03:48] Tested 115 tests, 115 passes, 0 failures: PASS
[15:03:48] Tested 70 tests, 70 passes, 0 failures: PASS
[15:03:57] Finished 'build' after 10 s
[15:03:57] Starting 'includeShaders'...
[15:03:57] Finished 'includeShaders' after 1.73 ms
[15:03:57] Starting 'shaders'...
[15:03:57] Finished 'shaders' after 790 μs
[15:03:57] Starting 'buildCore'...
[15:03:57] Tested 38 tests, 38 passes, 0 failures: PASS
[15:03:57] Tested 53 tests, 53 passes, 0 failures: PASS
[15:03:57] Tested 115 tests, 115 passes, 0 failures: PASS
[15:04:03] Finished 'buildCore' after 6.42 s
[15:04:03] Finished 'default' after 27 s
[15:04:03] Finished 'typescript' after 36 s
[15:04:03] Starting 'canvas2D'...
[15:04:03] Starting 'materialsLibrary'...
[15:04:03] Starting 'postProcessesLibrary'...
[15:04:03] Starting 'proceduralTexturesLibrary'...
[15:04:03] Starting 'loaders'...
[15:04:03] Starting 'serializers'...
[15:04:03] Starting 'inspector'...
[15:04:19] Finished 'serializers' after 16 s
[15:04:20] Finished 'postProcessesLibrary' after 17 s
[15:04:20] Finished 'proceduralTexturesLibrary' after 17 s
../../loaders/src/glTF/babylon.glTFFileLoader.ts(837,29): error TS2540: Cannot assign to 'useBones' because it is a constant or a read-only property.
[15:04:21] TypeScript: 1 semantic error
[15:04:21] TypeScript: emit succeeded (with errors)
[15:04:22] Finished 'materialsLibrary' after 19 s
[15:04:22] Finished 'loaders' after 19 s
../../inspector/src/adapters/Canvas2DAdapter.ts(29,82): error TS2694: Namespace 'BABYLON' has no exported member 'Prim2DPropInfo'.
../../inspector/src/details/PropertyLine.ts(12,25): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(13,44): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(16,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(18,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(20,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(22,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(27,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(29,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(31,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(33,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/lib.d.ts(2,1): error TS6053: File '/home/wink/foss/Babylon/Babylon.js.my-fork/dist/preview release/canvas2D/babylon.canvas2D.d.ts' not found.
../../inspector/src/properties.ts(122,27): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(126,27): error TS2339: Property 'PrimitiveThickness' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(130,27): error TS2339: Property 'BoundingInfo2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(134,27): error TS2339: Property 'SolidColorBrush2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(138,27): error TS2339: Property 'GradientColorBrush2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/tabs/Canvas2DTab.ts(14,37): error TS2339: Property 'Canvas2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/tabs/Canvas2DTab.ts(17,54): error TS2694: Namespace 'BABYLON' has no exported member 'Prim2DBase'.
../../inspector/src/tabs/Canvas2DTab.ts(22,45): error TS2694: Namespace 'BABYLON' has no exported member 'Prim2DBase'.
../../inspector/src/tabs/Canvas2DTab.ts(39,35): error TS2694: Namespace 'BABYLON' has no exported member 'Canvas2D'.
../../inspector/src/tabs/Canvas2DTab.ts(39,62): error TS2694: Namespace 'BABYLON' has no exported member 'Canvas2D'.
../../inspector/src/tabs/TabBar.ts(34,25): error TS2339: Property 'Canvas2D' does not exist on type 'typeof BABYLON'.
[15:04:27] TypeScript: 23 semantic errors
[15:04:27] TypeScript: emit succeeded (with errors)
[15:04:28] Finished 'canvas2D' after 25 s
[15:04:28] Finished 'inspector' after 25 s
[15:04:28] Starting 'typescript-libraries'...
[15:04:28] Finished 'typescript-libraries' after 27 μs
[15:04:28] Finished 'typescript-all' after 1 min
[15:04:28] Version: webpack 1.14.0
                  Asset    Size  Chunks             Chunk Names
f530471f1d7628fb8a49.js  116 kB       0  [emitted]  main

 

And the output indicates some errors and below we can see many more .js file modified:

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   ../../dist/preview release/babylon.core.js
	modified:   ../../dist/preview release/babylon.d.ts
	modified:   ../../dist/preview release/babylon.js
	modified:   ../../dist/preview release/babylon.max.js
	modified:   ../../dist/preview release/babylon.noworker.js
	modified:   ../../dist/preview release/canvas2D/babylon.canvas2d.d.ts
	modified:   ../../dist/preview release/canvas2D/babylon.canvas2d.js
	modified:   ../../dist/preview release/canvas2D/babylon.canvas2d.min.js
	modified:   ../../dist/preview release/inspector/babylon.inspector.d.ts
	modified:   ../../dist/preview release/loaders/babylon.glTFFileLoader.d.ts
	modified:   ../../dist/preview release/loaders/babylon.glTFFileLoader.js
	modified:   ../../dist/preview release/loaders/babylon.glTFFileLoader.min.js
	modified:   ../../dist/preview release/loaders/babylon.objFileLoader.js
	modified:   ../../dist/preview release/loaders/babylon.objFileLoader.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.fireMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.fireMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.furMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.furMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.gradientMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.gradientMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.gridMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.gridMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.lavaMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.lavaMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.normalMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.normalMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.simpleMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.simpleMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.skyMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.skyMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.terrainMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.terrainMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.triPlanarMaterial.min.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.waterMaterial.d.ts
	modified:   ../../dist/preview release/materialsLibrary/babylon.waterMaterial.js
	modified:   ../../dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
	modified:   ../../dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts
	modified:   ../../dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.js
	modified:   ../../dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
	modified:   ../../dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.d.ts
	modified:   ../../dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.js
	modified:   ../../dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.brickProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.brickProceduralTexture.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.d.ts
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.min.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.js
	modified:   ../../dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.min.js

 

Soooooo, what is the "right" way to use the command line and are the errors a problem?

Link to comment
Share on other sites

I use this : 

> cd Tools/Gulp
> gulp typescript

No compilation error at all : it compiles the whole bjs source into these files : 

babylon.core.js, babylon.d.ts, babylon.js, babylon.max.js, babylon.noworker.js

There is one compilation error though when using typescript-all :  [09:49:53] Finished 'proceduralTexturesLibrary' after 30 s
..\..\loaders\src\glTF\babylon.glTFFileLoader.ts(837,29): error TS2540: Cannot assign to 'useBones' because it is a constant or a read-only property.

 

Link to comment
Share on other sites

@Temechon, using gulp typescript seems reasonable, any reason that shouldn't be the default, seems to me we should always generate babylon.d.ts?

Regarding the typescript-all, as you can see I'm getting the same error:

[15:04:20] Finished 'proceduralTexturesLibrary' after 17 s
../../loaders/src/glTF/babylon.glTFFileLoader.ts(837,29): error TS2540: Cannot assign to 'useBones' because it is a constant or a read-only property.
[15:04:21] TypeScript: 1 semantic error
[15:04:21] TypeScript: emit succeeded (with errors)
[15:04:22] Finished 'materialsLibrary' after 19 s

But I'm also getting 23 other errors following that, in Canvas2D, are you getting those?:

[15:04:22] Finished 'loaders' after 19 s
../../inspector/src/adapters/Canvas2DAdapter.ts(29,82): error TS2694: Namespace 'BABYLON' has no exported member 'Prim2DPropInfo'.
../../inspector/src/details/PropertyLine.ts(12,25): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(13,44): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(16,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(18,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(20,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(22,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(27,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(29,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(31,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/details/PropertyLine.ts(33,42): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/lib.d.ts(2,1): error TS6053: File '/home/wink/foss/Babylon/Babylon.js.my-fork/dist/preview release/canvas2D/babylon.canvas2D.d.ts' not found.
../../inspector/src/properties.ts(122,27): error TS2339: Property 'PrimitiveAlignment' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(126,27): error TS2339: Property 'PrimitiveThickness' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(130,27): error TS2339: Property 'BoundingInfo2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(134,27): error TS2339: Property 'SolidColorBrush2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/properties.ts(138,27): error TS2339: Property 'GradientColorBrush2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/tabs/Canvas2DTab.ts(14,37): error TS2339: Property 'Canvas2D' does not exist on type 'typeof BABYLON'.
../../inspector/src/tabs/Canvas2DTab.ts(17,54): error TS2694: Namespace 'BABYLON' has no exported member 'Prim2DBase'.
../../inspector/src/tabs/Canvas2DTab.ts(22,45): error TS2694: Namespace 'BABYLON' has no exported member 'Prim2DBase'.
../../inspector/src/tabs/Canvas2DTab.ts(39,35): error TS2694: Namespace 'BABYLON' has no exported member 'Canvas2D'.
../../inspector/src/tabs/Canvas2DTab.ts(39,62): error TS2694: Namespace 'BABYLON' has no exported member 'Canvas2D'.
../../inspector/src/tabs/TabBar.ts(34,25): error TS2339: Property 'Canvas2D' does not exist on type 'typeof BABYLON'.
[15:04:27] TypeScript: 23 semantic errors
[15:04:27] TypeScript: emit succeeded (with errors)
[15:04:28] Finished 'canvas2D' after 25 s

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...