Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is it possible to extend a component that is derived from a ComponentLibrary?

Question

I’m working with Roku’s SceneGraph framework and need to extend a component from my ComponentLibrary.

What I’m trying to achieve

I want to allow consumers of my library to extend components using SceneGraph’s extend feature. For example, enabling them to create a CustomController (derived in the component library consumer) that extends my library’s AbstractController (derived in the ComponentLibrary) component.

What I’ve tried

I attempted to extend the component by referencing the library name and component name:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<component name="CustomController" extends="ComponentLib:AbstractController">

This resulted in compile errors.

>Solution :

Unfortunately no, extending a component from a component library is not supported. This is because component libraries are loaded at runtime, whereas your app is compiled far sooner in the process. Think of the timing of events like this:

  1. Zip your app, upload it to a Roku device
  2. Roku compiles your app.
  3. Roku runs your app
  4. Your app downloads and registers a component library
  5. When the component library finishes loading, you can start using components from it

So as you can see, the problem is you cannot get past step 2 when the components you need to extend are from step 5.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading