Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library swc with [Bindable] "unknown error" #32

Closed
teotigraphix opened this issue Jan 6, 2016 · 18 comments
Closed

Library swc with [Bindable] "unknown error" #32

teotigraphix opened this issue Jan 6, 2016 · 18 comments
Labels
Milestone

Comments

@teotigraphix
Copy link

Just curious if you have ever run into this before trying to use [Bindable] in a library project.

Months ago I go it as well but just was tinkering again with a mxml component in a library and ran into this again.

capture

@joshtynjala
Copy link
Member

I haven't seen that error before. However, I don't think I've actually tried building a library project with the Feathers SDK yet. Well, other than the SWC files that are included in the SDK.

Are you referencing feathers.swc in your library project? If so, where exactly did you get this SWC? I'm asking because you might run into trouble if you try to use a feathers.swc that didn't come from your copy of the Feathers SDK.

@teotidev
Copy link

teotidev commented Jan 6, 2016

I am using the SDK's libs directory. (FeathersSDK/frameworks/libs) as a Global Library in IDEA for "code highlighting" and then the normal Feathers SDK entry for building.

My projects are pretty complex with some deps so I haven't tried to really narrow if I have some weird circular conflict but I don't think I do.

@joshtynjala
Copy link
Member

I realized, after I asked you that question, that it didn't make sense. The appropriate feathers.swc would be loaded automatically by the IDE.

@teotidev
Copy link

teotidev commented Jan 6, 2016

You can close this if you want, since I doubt it will be anything you can figure out. Was more a question to see if you had run into it.

@joshtynjala
Copy link
Member

I'll leave it open, in case anyone else has the same issue and they can provide more details.

@teotidev
Copy link

I was just working in FB 4.7 and I get this same error with a Library Project.

Basically I have ONE library project and just try to use [Bindable] in it and I get the "Unknown error".

So this means it's a problem with the SWC compiler and not just IntelliJ.

@joshtynjala
Copy link
Member

I can reproduce. Thanks.

@joshtynjala
Copy link
Member

It appears to be related to using [Bindable] metadata without an explicit event. When I specified an event, like [Bindable("change")], it works. Weird.

@joshtynjala joshtynjala added this to the 3.0 milestone Jan 14, 2016
@teotigraphix
Copy link
Author

So that means I have to add dispatchEvent to use it correct? I didn't even think to try that. Being able to add Bindable in a SWC would be great now. :)

@teotigraphix
Copy link
Author

Maybe there is a null pointer in the code generation or something. So the unknown error is catching something like that.

@joshtynjala
Copy link
Member

So that means I have to add dispatchEvent to use it correct?

Yeah, you'll need to dispatch the event manually when you specify it in the metadata.

Maybe there is a null pointer in the code generation or something. So the unknown error is catching something like that.

When compiling with compc on the command line, I see "Error: null" in the output. I just need to find where that's happening.

@teotigraphix
Copy link
Author

OT - Do you still use FB for any dev?

@joshtynjala
Copy link
Member

I only test with Flash Builder. I do real development in IntelliJ IDEA.

@joshtynjala joshtynjala changed the title Library swc with [Bindable] "unkown error" Library swc with [Bindable] "unknown error" Feb 9, 2016
@joshtynjala
Copy link
Member

More details: The result of analyzeClass() at BindableFirstPassEvaluator line 254 is unexpectedly returning null.

ClassInfo classInfo = typeTable.getSymbolTable().getTypeAnalyzer().analyzeClass(context, new MultiName(NameFormatter.toColon(NodeMagic.getClassName(node))));

If I recall correctly, I encountered the same "Error: null" message at this location when I was originally working on adding support for [Bindable]. I tried to call bindableInfo.getClassInfo() and received null. Using analyzeClass() instead was an alternate solution that worked for the mxmlc compiler. It seems that is not the case in compc, for some reason.

@teotigraphix
Copy link
Author

I'm going to be getting some time coming up in the spring, I use this MXML stuff so heavily now in my business I am thinking about Falcon support. I pretty much know that compiler inside and out and am curious what I would have to do to get initial hello world happening with it.

Josh, FYI I am seriously thinking about this, do you see anything that would be a no go or do you think you could offer some guidance to get me going on principles some time?

@joshtynjala
Copy link
Member

That would be really cool, Mike! Off the top of my head, there needs to be some kind of Starling initialization that happens behind the scenes. The older compiler generates a class that extends feathers.core.StarlingBootstrap, and it overrides a method named info().

As I understand it, Falcon handles binding a little differently than the older compiler. I haven't looked into the details, but Alex said that more happens on the ActionScript side. A lot of code is generated by the older compiler for binding, so this part could be challenging.

If you can get a prototype up and limping, I can probably handle cleaning up the rest.

@joshtynjala
Copy link
Member

Okay, I've been doing some more investigation, and I figured out why the call to analyzeClass() in BindableFirstPassEvalulator works in mxmlc but not compc.

In mxmlc, it works because the class with [Bindable] metadata is pretty much always referenced by another class that gets handled first. The [Bindable] class will already be registered in the SymbolTable. In compc, it may not be referenced by anything, so it won't be in the SymbolTable yet.

@joshtynjala
Copy link
Member

So I was able to move the import into a different class after the SymbolTable was populated, and it appears to be working!

joshtynjala added a commit that referenced this issue Apr 19, 2016
…atcher for [Bindable] metadata because the class may extend a subclass of EventDispathcer, and it wouldn't be imported otherwise (references #32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants