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

Documentation? #24

Open
darktasevski opened this issue Jun 18, 2020 · 6 comments
Open

Documentation? #24

darktasevski opened this issue Jun 18, 2020 · 6 comments

Comments

@darktasevski
Copy link

Is there any documentation or example on how is this framework supposed to be used? I'm still kinda new to brightscript, experimenting a bit with scenegraph last few days, and would like to try out this framework, but I have no idea how, for example, navigation should work.

If I'm correct onNavigateTo is similar to componentDidMount React lifecycle hook and onNavigateAway is kinda like componentWillUnmount.
I see that onNavigateAway accepts navigationParams.params but I don't know how params look like. Also, I see that onNavigateAway doesn't take any arguments, how Brightscript knows what Controller should be displayed when we navigate away from Home controller for example?

@bbonet-entercom
Copy link

I think it's the top level controllerState value? I'm new to this too and I'm updating an existing application.

@jfrux
Copy link
Contributor

jfrux commented Aug 18, 2020

Anybody know how to just navigate to a different controller?

@darktasevski
Copy link
Author

If I remember correctly, that's being done by changing the loadController field in the BaseScene component.

@jfrux
Copy link
Contributor

jfrux commented Aug 19, 2020

Anybody find this methodology limiting them later in development?
Georgejecook seems to like MVVM for Roku dev, just trying to gauge how I want to do my next rewrite... I know they're similar in concept but not sure what makes the most sense for Roku specifically.

@darktasevski
Copy link
Author

IMO, from the Roku newbie standpoint, this methodology was working very nicely; I've created a few Controllers and experimented with navigation between them, and it was working as expected. Not sure what limitations you have in mind?

Ultimately, I've given up on this framework because it's not really documented, there were parts of the code I wasn't sure what are doing, and I had a few nasty race conditions with HTTP requests 😅 Might be because I'm still kinda new to Brs, but I've decided to build something on my own.

Maestro framework looks nice, but it still has a lot of code overhead and complexity, not really something to get with a start and running for fresh Roku devs.

@mrkjffrsn
Copy link
Owner

@jfrux @Puritanic @bbonet-entercom Thanks for helping each other out in this forum.

Yes. That is right. To move to a new controller, you'd need to set an associative array object to this prop loadController on the base scene.

scene.loadController = { page: "NAME_CONTROLLER_COMPONENT", params: { }, skipHistory: false }
  • page - String - Name of the controller component. This component needs to extend BaseController
  • params - Assoc Array - Any data that you might want passed to the controller when being created and attached to the scene
  • skipHistory - Boolean - When set to true, this controller is ignored from the navigation stack. This could come in handy when you want an interstitial page during a certain user flow that requires a mid screen to not be preserved in navigation stack.

***NOTE: Controller component contains a special property called controllerState. Any assoc array object can be stored here and this is useful especially when you want certain data to be preserved when navigating back from the nav stack to restore the previous screens state.

All being said this is an opinionated framework that i've used for at least 4 production apps. It has been successfully used to render complex views such an Electronic Program Guide and containing screens where a video player is maintained through the app session.

@Puritanic Please share the framework you build. I'd love to take a look at it. Happy to help with any race conditions you may have experienced in regards to the HTTP network calls you made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants