botmaster Posted October 9, 2017 Share Posted October 9, 2017 I have an extensive framework built on top of pixijs 4.0.1 (mostly using composition) that we use with many of our apps but now I'd like to update to 4.5.6 and not much between both is compatible as far as I can tell. I'll probably have to go class by class and fix/update everything as I go and kinda hope everything will work at the end but I was wondering if any of you guys have some pointers as to which areas of pixi framework are fairly compatible and which are not (might save me some time). On another note I got the ts definition for 4.5.6 here: https://github.com/pixijs/pixi-typescript and I get some errors in visual studio on that line: type UniformDataMap<U> = {[K in keyof U]: UniformData<U[K]>}; declarations/pixi.js.d.ts(1288,43): error TS1005: ']' expected. declarations/pixi.js.d.ts(1288,44): error TS1005: ';' expected. declarations/pixi.js.d.ts(1288,45): error TS1128: Declaration or statement expected. declarations/pixi.js.d.ts(1288,61): error TS1005: ']' expected. declarations/pixi.js.d.ts(1288,62): error TS1005: ',' expected. declarations/pixi.js.d.ts(1288,64): error TS1005: '(' expected. declarations/pixi.js.d.ts(3520,1): error TS1128: Declaration or statement expected. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 9, 2017 Share Posted October 9, 2017 Update your typescript version, you need 2.0 at least. Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 9, 2017 Author Share Posted October 9, 2017 Thx for your reply, I'm on 2.5.3, could it be too high? Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 9, 2017 Author Share Posted October 9, 2017 I "fixed" the pixi.js.d.ts by commenting out this and changing 'object' to 'Object', not great I know //type UniformDataMap<U> = {[K in keyof U]: UniformData<U[K]>}; export class Filter<U extends Object> { //constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: UniformDataMap<U>); //protected uniformData: UniformDataMap<U>; Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 9, 2017 Share Posted October 9, 2017 Please create an issue at pixi-typescript github. Im not good with versions but I believe that you have typescript 1.8 somewhere, alive. The typescript service that is used by visual studio somehow is using older version of TS. botmaster 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 9, 2017 Author Share Posted October 9, 2017 Thx that seems possible, I'll look into this. At the bottom of my VSC it says "Typescript 2.5.3" but I'll see if maybe it still compiles using an old tsc somewhere. Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 9, 2017 Author Share Posted October 9, 2017 Thx this was the problem, code was checked with 2.5.3 but compiled with 2.0.3. I forced another upgrade and finally overrided 2.0.3 with 2.5.3. Boy that pixi version is so incompatible with 4.0.1, they should really name it 5. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 9, 2017 Share Posted October 9, 2017 That's mostly pixi-ts typings incompatibility. Btw, what parts were triggered in your app? Also, there's v5 and there will be big changes in internal parts. It depends on how deeply you use pixi botmaster 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 9, 2017 Author Share Posted October 9, 2017 It's a framework that mirrors flash major packages (events, display, net, ect ...) bpixijs objects are used with composition in all classes, so in theory any engine can be plugged to the framework with a bit of work. It's easy to fix what's missing/not working anymore, what's harder is integrate new pixi features to replace old workarounds of what was missing in 4.0.1 since I have to discover them. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 9, 2017 Share Posted October 9, 2017 Yeah, im making this kind of thing too! So, you are basically emulating flash stage with it, fun! You can ask me for those changes, ill answer botmaster 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 10, 2017 Author Share Posted October 10, 2017 We convert our as3 code to typescript (in house converter) so all flash packages/classes have to match and we end up with a html5 and flash app from the same code. Now I noticed (with pixi 4.0.1) the android support is spotty but with 4.5.6 I couldn't find one android device that couldn't run it thus the need to update. So far the biggest work seem to be with the event system and text since those are very different but I also see they are a lot better. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 10, 2017 Share Posted October 10, 2017 Yeah, I'm working on project that can do the same thing. Yeah, events were changed seriously, it now passes "event" instead of argument in all InteractionManager functions. And text became much better Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 10, 2017 Share Posted October 10, 2017 Just for comparsion. How many lines of code is it? Does it use pure flash API or there are 3d calls too (like Genome or so)? Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 10, 2017 Author Share Posted October 10, 2017 We didn't integrate 3D as we never use it here (so far) but our typescript/flash is 234 classes, bunch in display, media (simulate Sound API), net, events, and the whole Timer thing which we might change and base on the ticker.add instead. It's not a lot of classes since we only did what we needed. But our base as3 code outputs to Desktop, Ios, Android and Web so we needed to get a html5 engine in the mix. Here a little video I made to show the system on the adobe forums. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 10, 2017 Share Posted October 10, 2017 How exactly proprietary is your product? Is there a website about it? I'm using sources for Haxe openfl and Shumway to create separate stage tree that can use the same renderer as pixi. Whole app that is using it has ~10MB of code, its several thousands of classes. For UI its flash tree, but the field is different: its a tree that is faster both PIXI and flash, has pixel-perfect interaction with animations, and can work on old Indel GMA3000: botmaster 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 10, 2017 Author Share Posted October 10, 2017 That looks nice, no this is in-house product developed just for what we needed which is keep our as3 code base and keep supporting all platforms so for web that meant converting to typescript on the fly and still get the same product. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 10, 2017 Share Posted October 10, 2017 How do you solve problem with int/uint behaviour? Do you convert it class-by-class, or you somehow use TypeChecker? This is result of one of our experiments: https://github.com/Microsoft/TypeScript/issues/17861 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 10, 2017 Author Share Posted October 10, 2017 It's converted to initialized number by default and special cases are handled by special routines. I was afraid about how much would break in my physic engine and honestly to my surprise it converted and worked out of the box! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 10, 2017 Share Posted October 10, 2017 We actually implemented "int" and "uint" in typescript using transforms, so now we have new script language in the middle: TS with some extra types I was hysterical when we made those type definitions: class Fake1 { } class Fake2 { } type int = number & Fake1; type uint = number & Fake2; var x: int; x = 0; var y = x; //type of y is "int" botmaster 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 10, 2017 Author Share Posted October 10, 2017 That's pretty cool, and is this global? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 10, 2017 Share Posted October 10, 2017 Yes, those are global types. We also have dealt with Vector<XXX> and instanceof's , casts and many other things. What about testing? Do you have testing engine that runs same test in AS and TS? botmaster 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 10, 2017 Author Share Posted October 10, 2017 I need to look into the Vector stuff then, I auto convert to T[] which is not bad but you are giving ideas for later. My company has very low testing budget so I won't extend on this .... The true one thing I don't directly handle in converting is XML, so I handle this case by case but I pushed long ago for the use of JSON and web services and that paid off when converting to typescript cos XML is a big pain. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted October 13, 2017 Author Share Posted October 13, 2017 Almost done with the update, it wasn't so bad after all. Btw I do use static getter/setter sometimes but those produce errors now with ts 2.5.3, do you know a way of getting around that? 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.