HaxeFoundation / hx3compat

Haxe 3 compatibility lib for Haxe 4
MIT License
16 stars 16 forks source link

Is haxe remoting no longer works here? #9

Closed kevinresol closed 5 years ago

kevinresol commented 5 years ago
var cnx = haxe.remoting.HttpAsyncConnection.urlConnect('https://lib.haxe.org/api/3.0/index.n');
cnx.api;

With haxe 4 + hx3compact, the code above will complain something like haxe.remoting.HttpAsyncConnection has no field api I reckon this happens because it requires compiler support.

I just want to make sure if this is the expected behaviour. And if it is expected, then I think there is no way to interact with the haxelib api with haxe 4 (besides manually constructing/parsing the remoting call/result?)

simonRiep commented 5 years ago

using Haxe Compiler 4.0.0-preview.5+7eb789f54 happend to have the same problem in a project of mine worked with resolve:

class Api extends AsyncProxy { } class Client { static var api: Api; static function main() { var URL = "api.n"; trace(URL); var cnx = HttpAsyncConnection.urlConnect(URL); trace(cnx); api = new Api(cnx.resolve("Api")); api.testAdd(3, 4, function(i: Float) { trace(i); } ); } }

kevinresol commented 5 years ago

Right, .resolve() is the solution.