RaananW Posted February 12, 2015 Share Posted February 12, 2015 No no, only the objects that causes the errors. Shouldn't take longer than five minutes Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 12, 2015 Share Posted February 12, 2015 (edited) Ok, inspected it further.I just pushed a PR to github with a fix that I hope will solve this entire thing.https://github.com/BabylonJS/Babylon.js/pull/403It is an update to the gulpfile and npm's package file, including new dependencies. BabylonJS supports typescript 1.0.? at the moment, and this fix forces the typescript compiler to be this version.Map files are generated, declaration files are generated as well (if wanted).Wait for DK to merge it or simply update your gulpfile and package files. Next thing would be to solve the compatibility issues with typescript 1.4PR for ts 1.3 is here - https://github.com/BabylonJS/Babylon.js/pull/404 Edited February 12, 2015 by RaananW Wingnut and Vousk-prod. 2 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 12, 2015 Share Posted February 12, 2015 Great ! Thanks. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 14, 2015 Share Posted February 14, 2015 PR validated. Sorry for being so slow but I was in France for TechDays Quote Link to comment Share on other sites More sharing options...
jerome Posted February 14, 2015 Author Share Posted February 14, 2015 CHAMPAGNE !!!! "Pop " Ok, I test it ASAP Quote Link to comment Share on other sites More sharing options...
jerome Posted February 14, 2015 Author Share Posted February 14, 2015 tested .... suspense Works However the typescript-to-js task didn't work at first run (despite I installed and updated dependencies) : it missed the merge2 npm module.Added manually (as sudoer) :npm install merge2Now it works !!!Every ts file is well compiled into js file with TS 1.4 Congratulations RaananW Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 14, 2015 Share Posted February 14, 2015 Yes, thank you !! It works for me, and also in Eclipse.Good job ! Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 14, 2015 Share Posted February 14, 2015 Glad it works!to install the new dependencies you need to run npm install in the gulp directory.The Windows "command line is too long" error should be solved too. If something's not working with gulp, let me know. Quote Link to comment Share on other sites More sharing options...
jerome Posted February 14, 2015 Author Share Posted February 14, 2015 Yep, this is what I did when it claimed for merge2 (don't know why)Anyway, that's not important as I manually added it. The important thing is that YOU achieved to give us a updated (and updatable) working environment Thanks again Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 14, 2015 Share Posted February 14, 2015 Hmmm... I thought I removed the merge requirement :-) Just checked, I left it in... Removed it, now this shouldn't happen as well. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted March 10, 2015 Share Posted March 10, 2015 I'd like to post my working environnement to this thread http://www.html5gamedevs.com/topic/12460-contribution-validated-working-environments/but I have a last micro trouble with my setup : When I compile TS to JS, all my JS files are mapped this way//# sourceMappingURL=../Actions/babylon.actionManager.js.mapinstead of that way ://# sourceMappingURL=babylon.actionManager.js.map And that's pretty annoying because Git thinks that I have to commit all those JS files at each slightest tiny little change. I'm using gulp 3.8.1, tsc 1.4.1.0, gulp-sourcemaps 1.3.0 and the BJS/Tools/Gulp/gulpfile.js with no modification. Any idea ? Quote Link to comment Share on other sites More sharing options...
jerome Posted March 11, 2015 Author Share Posted March 11, 2015 Sounds like the same symptom I encountered each time I had to PR (force to commit all JS compiled files) Where is this sourceMappingURL parameter ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 11, 2015 Share Posted March 11, 2015 This is caused due to the different way those files are compiled in different machines.I'll try checking if gulp can reference the map files differently, maybe this will solve the problem for you. Thou if I remember correctly it also adds an extra empty line for some reason. I'll check and let you know.Btw, when I use gulp I always revert all changes in .js files after compiling (except the main babylon files), this way I have an updated version and git didn't go all crazy :-) Quote Link to comment Share on other sites More sharing options...
jerome Posted March 11, 2015 Author Share Posted March 11, 2015 How do you revert all changes in .js files ? manually one by one in their own folders ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 11, 2015 Share Posted March 11, 2015 I personally use TortoiseGit which has this option in its UI. I am pretty sure all git UI interface has this option one way or another. Might be names differently (Tortoise is, I think, an SVN-oriented Git client :-) so revert comes from SVN in that case. I think native git people would call this "discard". But I might be wrong ). Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted March 11, 2015 Share Posted March 11, 2015 I also only commit the changed TS and revert all JS, to keep branch and PR merging as clean as possible.I'm using GitExtension and there also simply is an option to do that easily (I was previously using Tortoise for SVN but once starting Git I tried many clients and found GitExtension the more powerfull, easy, and versatile). Quote Link to comment Share on other sites More sharing options...
jerome Posted March 11, 2015 Author Share Posted March 11, 2015 here :SublimeText 2 + git plugin used to commit edited TS files individuallySmartGit or git command line to manage fetch/checkout/branches/merge/pushGulp (the provided bjs recipe) to compile and build in order to test locally however, I don't know how to revert all compiled js files at once Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted February 23, 2017 Share Posted February 23, 2017 I have spent hours trying to jump into typescript for the first time with sublime text. Sublime Text will compile my typescript and if I manually copy over the .js files it creates I can get my game to run. However I am trying to automate with Gulp and Browserify and I am getting compile errors. I don't understand what I am supposed to do and it's getting frustrating. I'm surprised there is no example or tutorial that covers this situation. If I can get it working then I will publish a how-to for newbies. I think a lot of people must have been in the same position as me and given up. Errors I get from my Gulp: events.js:161 throw er; // Unhandled 'error' event ^ TypeScript error: node_modules/typescript/lib/lib.d.ts(5603,11): Error TS2320: Interface 'AudioContext' cannot simultaneously extend types 'AudioContextBase' and 'EventTarget'. Named property 'addEventListener' of types 'AudioContextBase' and 'EventTarget' are not identical. Quote Link to comment Share on other sites More sharing options...
jerome Posted February 23, 2017 Author Share Posted February 23, 2017 I would recommend to systematically use the command line : "gulp typescript" what makes plenty of tests and build the library for you. Moreover, it's updated by the core team each time some internal dependencies are added, so you don't have to care about all this stuff. [EDIT] now I use VSCODE editor for linux what works out-of-the-box with typescript and BJS Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted February 23, 2017 Share Posted February 23, 2017 I don't think I want to build the whole Babylon.js though. I just want to compile my game, which I am trying to write in Typescript. Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted February 23, 2017 Share Posted February 23, 2017 Basically I want something like Techemon's game here https://github.com/Temechon/escape But with Gulp instead of Grunt, and with Sublime Text. Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted February 23, 2017 Share Posted February 23, 2017 I have continued to fail to get browserify working for this, but I do have gulp-typescript working for now. If anyone comes here from google, here is the most basic TypeScript build gulpfile.js that you can use as a starting point: 'use strict'; var gulp = require('gulp'); var ts = require("gulp-typescript"); var paths = { pages: ['index.html'], ts: [ 'ts/babylon.2.5.d.ts', 'ts/game.ts', ] }; gulp.task("ts", function () { return gulp.src(paths.ts) .pipe( ts({ //noImplicitAny: true, module: 'amd', target: 'es5', declaration: false, sourceMap: true, removeComments: false, //out: 'output.js' }) ) .pipe(gulp.dest('dist/js')); }); - You do NOT need to add an 'export' line to babylon.d.ts. - You do NOT need an import line in your game.ts to reference babylon.d.ts. - Put babylon.d.ts and game.ts in the "files" section of your tsconfig.json. Temechon and jerome 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 23, 2017 Share Posted February 23, 2017 Check my response on your other post Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.