fluid-tech IRC Logs-2012-09-21

fluid-tech IRC Logs-2012-09-21

[13:58:16 CDT(-0500)] <anastasiac> Bosmon, are you there?

[13:58:28 CDT(-0500)] <Bosmon> Hi, anastasiac

[13:58:36 CDT(-0500)] <anastasiac> hi

[13:59:04 CDT(-0500)] <anastasiac> I have a question about when a "subcomponent" is ready to be accessed.

[13:59:14 CDT(-0500)] <Bosmon> An excellent question

[13:59:22 CDT(-0500)] <anastasiac> I've got another subcomponent that uses "createOnEvent" to wait for the "onReady" event of the first

[13:59:36 CDT(-0500)] <anastasiac> but the first is also doing an asynchronous load of something that completes after the onReady

[13:59:56 CDT(-0500)] <anastasiac> would this prevent the component from actually being "ready" at the end of the finalInit (when the onReady event is being fired)?

[14:00:09 CDT(-0500)] <Bosmon> anastasiac - that would be a matter for your opinion

[14:00:39 CDT(-0500)] <anastasiac> well, I'm getting an error saying "stop trying to access the component before it's ready!!" so it's not just my opinion

[14:00:47 CDT(-0500)] <Bosmon> I see

[14:00:58 CDT(-0500)] <Bosmon> That is most likely nothing to do with the asynchronous load

[14:01:07 CDT(-0500)] <anastasiac> ok, I didn't think it would be that

[14:01:08 CDT(-0500)] <Bosmon> But to do with the way you have written the IoC configuration

[14:01:19 CDT(-0500)] <anastasiac> but I can't figure out what the problem is

[14:01:47 CDT(-0500)] <Bosmon> After the fluid.fail message, there should be a list of the references that were being resolved at the time it found the circularity

[14:01:55 CDT(-0500)] <anastasiac> right

[14:07:18 CDT(-0500)] <anastasiac> Bosmon, I can't tell what the problem is. Here's the tree: Parent component is VideoPlayer. It has two subcomponents: controllers and transcripts. I want to create an eventBinder subcomponent (of the VideoPlayer) that will not be created until after controllers and transcript have been created

[14:07:55 CDT(-0500)] <anastasiac> I've created an aggregate event on the VideoPlayer that combines the onReady of the two subcomponents: controllers and transcript. The eventBinder has 'createOnEvent' of that aggregate event

[14:08:05 CDT(-0500)] <anastasiac> does that seem reasonable so far, Bosmon?

[14:08:09 CDT(-0500)] <Bosmon> Sounds good

[14:08:58 CDT(-0500)] <anastasiac> the event binder has a demands block that adds a listener for one of the transcript subcomponent's event, the one that fires after the end of the asynchronous load

[14:09:15 CDT(-0500)] <anastasiac> when the framework tries to resolve that event, it claims the transcript component is still in creation

[14:10:01 CDT(-0500)] <Bosmon> How are you firing the onReady event of the transcript component?

[14:11:09 CDT(-0500)]

<anastasiac> in the subcomponent specification, using "onReady: "

Unknown macro: {videoPlayer}

.events.onTranscriptReady" (my aggregate event uses events.onTranscriptReady)

[14:11:41 CDT(-0500)] <anastasiac> well, the transcript subomponent just uses that.events.onReady.fire() at the end of the finalInit, of course

[14:11:57 CDT(-0500)] <Bosmon> "of course" : P

[14:12:03 CDT(-0500)] <Bosmon> Have you tried using the new framework "onAttach" event?

[14:12:14 CDT(-0500)] <anastasiac> never hear of it do tell!

[14:12:17 CDT(-0500)] <Bosmon> During finalInit, the component will still be considered "in creation" by the framework

[14:12:30 CDT(-0500)] <anastasiac> yeah - things are just getting too fast for their own good

[14:13:53 CDT(-0500)] <anastasiac> oh, this "onAttach" looks like it might be just what I need. Just figuring out how to use it...

[14:14:10 CDT(-0500)] <Bosmon> I thought I had explained this better somewhere.... https://github.com/fluid-project/infusion/pull/236

[14:14:13 CDT(-0500)] <Bosmon> It is FLUID-4257

[14:14:23 CDT(-0500)] <Bosmon> But I can't at the moment lay my hands on where the full explanation is...

[14:15:52 CDT(-0500)] <anastasiac> so I'm still perusing, but it looks like I'd simply wait for "onAttach" instead of "onReady" - is that basically it?

[14:16:08 CDT(-0500)] <Bosmon> Yes, after "onAttach" the component is fully constructed and in place in the tree

[14:16:18 CDT(-0500)] <anastasiac> oh, this sounds like just what I need

[14:16:49 CDT(-0500)] <anastasiac> aargh

[14:16:57 CDT(-0500)] <Bosmon> https://github.com/fluid-project/infusion/blob/master/src/webapp/tests/framework-tests/core/js/FluidIoCTests.js#L857-996

[14:17:10 CDT(-0500)] <Bosmon> In general this test case is a good guide as to exactly when you can expect each event to fire

[14:17:12 CDT(-0500)] <anastasiac> looks like I'll have to upgrade the videoPlayer's version of infusion to get it!

[14:17:18 CDT(-0500)] <Bosmon> Certainly

[14:17:29 CDT(-0500)] <anastasiac> yep, I was looking at those tests

[14:18:26 CDT(-0500)] <Bosmon> The block near the end holds a transcript of the expected event firing sequence

[15:02:33 CDT(-0500)] <anastasiac> Bosmon, I'm still investigating, but can you think of any framework changes in the last couple of months which might break the use of the indirectReader grade in the VideoPlayer, or the use of custom grades?

[15:04:38 CDT(-0500)] <Bosmon> There has been a change to the way we operate mergePolicies

[15:04:42 CDT(-0500)] <Bosmon> What kind of problem are you seeing?

[15:05:55 CDT(-0500)] <anastasiac> the indirectReader grade adds the 'readIndirect' method to the component, and the error is that the method doesn't exist

[15:06:13 CDT(-0500)] <anastasiac> "that.readIndirect is not a function"

[15:06:38 CDT(-0500)] <anastasiac> that's the only error, no problems with resolution or instantiation, etc

[15:08:15 CDT(-0500)] <Bosmon> I assume somehow the preinitfunction isn't firing

[15:08:35 CDT(-0500)] <Bosmon> I guess if you put a breakpoint in it, you don't see it being called?

[15:09:05 CDT(-0500)] <anastasiac> hm. it does break

[15:09:14 CDT(-0500)] <anastasiac> so it is being called

[15:09:50 CDT(-0500)] <Bosmon> Ok

[15:09:52 CDT(-0500)] <Bosmon> That is peculiar

[15:10:14 CDT(-0500)] <anastasiac> ah, but maybe not all the time

[15:10:18 CDT(-0500)] <Bosmon> !

[15:10:21 CDT(-0500)] <anastasiac> possible not when combined with a rendererComponent

[15:10:23 CDT(-0500)] <anastasiac> let me check

[15:11:11 CDT(-0500)] <anastasiac> this is very odd

[15:11:52 CDT(-0500)] <Bosmon> Can you quickly check in your branch so I can take a look at it?

[15:12:27 CDT(-0500)] <anastasiac> yeah, but please forgive the messy code

[15:13:06 CDT(-0500)] <Bosmon> no problem

[15:13:33 CDT(-0500)] <anastasiac> Bosmon: https://github.com/acheetham/videoPlayer/tree/FLUID-4786

[15:13:52 CDT(-0500)] <anastasiac> most of the work is in VideoPlayer.js

[15:15:24 CDT(-0500)] <Bosmon> Ok

[15:15:28 CDT(-0500)] <Bosmon> Can I run one of the tests to see the problem?

[15:15:46 CDT(-0500)] <anastasiac> haven't tried that yet, just loading demos/videoPlayer.html

[15:15:53 CDT(-0500)] <Bosmon> ok

[15:16:08 CDT(-0500)] <anastasiac> yes, Bosmon

[15:16:13 CDT(-0500)] <anastasiac> the controls tests

[15:16:27 CDT(-0500)] <anastasiac> menu button tests

[15:16:45 CDT(-0500)] <anastasiac> but toggle button tests pass, and they use the indirectReader, Bosmon

[15:17:13 CDT(-0500)] <Bosmon> Ok yes, somehow the preInitFunction has failed to be picked up

[15:17:19 CDT(-0500)] <yura> Bosmon: hi

[15:17:26 CDT(-0500)] <Bosmon> And this worked with the version of the framework you had before?

[15:17:36 CDT(-0500)] <anastasiac> yes, it was fine

[15:17:51 CDT(-0500)] <anastasiac> and it's still being picked up some of the time

[15:35:51 CDT(-0500)] <Bosmon> Hi anastasiac - the problem seems even worse than that... it seems that for AT LEAST ONE of the languageMenu components, it has the preInitFunction correctly registered

[15:36:05 CDT(-0500)] <anastasiac> oh bozarre

[15:36:07 CDT(-0500)] <Bosmon> So it looks like the framework is corrupting its records of defaults structures somehow

[15:36:15 CDT(-0500)] <Bosmon> I will take a look later on this faternoon

[15:36:26 CDT(-0500)] <yura> Bosmon: regarding the require stub, what in your opinion is a good approach for finding the file with the module path spec ?

[15:37:30 CDT(-0500)] <anastasiac> thanks so much, Bosmon

[15:39:40 CDT(-0500)] <Bosmon> yura - perhaps a configurable path, which defaults to "../js/requireModules.json" or so?

[15:40:23 CDT(-0500)] <Bosmon> It's a bit disagreeable, but we could have a statically resolvable variable that the client could override in an emergency called something like fluid.clientRequires.path or so....

[15:40:36 CDT(-0500)] <yura> so are you suggesting it would be a file for each test?

[15:40:39 CDT(-0500)] <yura> set of tests?

[15:40:53 CDT(-0500)] <Bosmon> I guess it would, yes

[15:41:11 CDT(-0500)] <Bosmon> Just as each html file has a static list of .js includes in <head> ....

[15:42:05 CDT(-0500)] <Bosmon> Or if we had multiple .html files in a directory, we could adopt a simple convention based on modifying its filename to derive the module file