Improved diagnostic for listener resolution
Antranig Basman
antranig.basman at colorado.edu
Tue Jan 31 09:15:49 UTC 2012
Hi Cindy - thanks for taking the effort to compile this report.
In fact, the reference "{videoPlayer}.refresh" is fine and is resolved correctly by the framework.
The error actually lies in the reference "{videoPlayer}.onCaptionsLoaded" inside the captionLoader
subcomponent. This would most likely have been silently resolved incorrectly by the old framework, and is
correctly resolved to undefined by the new framework, but with a completely unhelpful diagnostic. The
correct reference here is "{videoPlayer}.events.onCaptionsLoaded".
I've issued a patch to issue a sensible diagnostic for this case under FLUID-4151:
https://github.com/fluid-project/infusion/pull/198
With this patch you should now receive a diagnostic like this:
02:12:09.254: ASSERTION FAILED: Error in listener record - could not resolve reference
{videoPlayer}.onCaptionsLoaded to a listener or firer. Did you miss out "events." when referring to an event
firer?
while resolving listener record for event named onCaptionsLoaded for component Object {
typeName="fluid.videoPlayer.captionLoader", id="5ig0id6z-97", nickName="captionLoader", more...}
while instantiating dependent component with name "captionLoader" with record Object {
type="fluid.videoPlayer.captionLoader", container="{videoPlayer}.container",
createOnEvent="onTemplateReady", more...} as child of Object { typeName="fluid.videoPlayer",
id="5ig0id6z-8", nickName="videoPlayer", more...}
Thanks,
Antranig
On 23/01/2012 14:48, Li, Cindy wrote:
> Hi Antranig,
>
> During the process of integrating the upgraded infusion into the video player, one issue is that the new infusion no longer works with the video player master branch that uses the combination of pulling in sub-components with decorators and referring to these sub-components using our magic curly brackets, which probably is not a proper scenario that IoC is happy with. The stopper in this case is that the video player throws javascript error: "listener is undefined" @ line 693 from "FluidIoC.js" at parsing a listener reference of "{videoPlayer}.refresh" as well as this type of other declarations.
>
> However, the new infusion works well with the re-constructed video player which replaces the decorators with the "component" declarations in the default block of the parent component.
>
> So, the question is same as the 'applyChange' discussion that was ongoing earlier this morning: should we maintain the backwards compatibility to continue supporting the sub-component referencing to the components that are declared via decorators?
>
> Two branches in case you need a demonstration of the problem:
>
> * The branch with the new infusion that branches off the video player master and throws js error:
> https://github.com/cindyli/videoPlayer/tree/FLUID-master-withNewInfusion
>
> * The branch with the new infusion that branches off the re-constructed video player and works well:
> https://github.com/cindyli/videoPlayer/tree/FLUID-4559-withNewInfusion
>
> Thanks
>
> Cindy
More information about the fluid-work
mailing list