ufront / ufront-mvc

The core MVC framework that powers ufront
MIT License
17 stars 15 forks source link

injection failing using compilation server #53

Open postite opened 8 years ago

postite commented 8 years ago

minimalistic example failing with compilation server. works good without

https://gist.github.com/postite/2059bc4600f8115a8469

bug or what ?

kevinresol commented 8 years ago

What is the error?

postite commented 8 years ago

hello @kevinresol . no explicit error . but injected string will be null . ( only with compilation server ) .

kevinresol commented 8 years ago

Hm, maybe a minject bug?

kevinresol commented 8 years ago

Can you reduce it to a minimal example and see if it is minject or ufront problem

postite commented 8 years ago

sorry for the late reply. my gist is already a very minimalistic ufront-setup i really don't know what to remove from here .

postite commented 8 years ago

btw i've just tried minject alone with compilation server and it works fine. so it's definitely a ufront bug we got here.

postite commented 8 years ago

fyi first two compilations work fine but then ... compilation runs ok but injected variable is null

kevinresol commented 8 years ago

This should be haxe-related. Let's track it at https://github.com/HaxeFoundation/haxe/issues/4892

postite commented 8 years ago

ok i've seen this! let the masters do their macro compiler Magic :)

kevinresol commented 8 years ago

@postite could you report your haxe version on that thread too?

Edit: I think Simn has figured out already. So no worry.

kevinresol commented 8 years ago

It turns out that it is not haxe's problem but minject's was coded in a way that is not compatible with the compilation server. I have pushed a fix to here.

That works, but it is not optimal. Because it uses onGenerate to modify the meta and onGenerate loops through all types, even they are already cached by the compilation server. Therefore I have changed onGenerate to use tink_syntaxhub (here), which will make it only process uncached types.

I will keep this open until the fix got merged into upstream minject

jasononeil commented 8 years ago

Thanks for looking into this @kevinresol. Let's see if the team at Massive Interactive are happy to merge. Hopefully!