Challenge Overview
This challenge is part of a new project involving React Native. The eventual goal is to have a way to build React Native apps for Hercule's embedded devices that communicate with the device over websockets. A previous challenge added on support for drawing and bootstrapping to the pxscene app, instead of an XRE receiver. This code challenge will fix a few issues and will expand that integration to include new features that have been added to the React Native --> XRE mapping.
Pxscene
We are using a framework called pxscene for a number of current projects. You can find more details here:
Recently documentation was added that describes how to integrate Visual Studio code debugger with pxscene for debugging local scripts:
https://github.com/johnrobinsn/pxCore/blob/master/examples/pxScene2d/VSCODE_DEBUG.md
General requirements
The goal of this challenge is to add in new support for keyboard handling and lyouts to our React Native server side flow.
As an overview, when a request is made to an app, like "http://{react-server}/{app_name}", we'll send down Javascript to pxscene that will handle the UI generation based on what the server sends down, and will also send events back to the server. Basically, the Javascript sent down from the server will act similar to how the XRE receiver works, where it sits between the graphics layer and the server, handling events that are sent down from the server, and raising events back up to the server based on user actions.
Keyboard support
We recently added keyboard support to the React-->XRE code. This challenge will expand that integration so that the examples can be navigated properly via the keyboard.
Layout server
A recent challenge implemented basic layout support to the XRE codebase. See commit hash 8c05c61c4a0cdafb41d285310268e0418004549c for an overview of what changed in the React-->XRE codebase. We want to extend the same support to the pxscene app.
Note that the layouts will be static against the size of the pxscene window when the app is launched. We don't expect the app to expand when the pxscene window is resized. The eventual pxscene window will be statically sized at either 1280x720 or 1920x1080 and won't be resized.
Single server
The previous challenge that implemented the main React-->pxscene integration required two servers - one for the server and another to host a basic Javascript redirect that can be loaded in pxscene. That's not what we're looking for - the end goal is a single server that can handle both pxscene and XRE clients. Please make sure that the routing and other pieces are updated to include everything necessary to run this as a single server, with the exact same React Native code serving both XRE and pxscene clients.
Examples
Your submission should support the all examples in the current codebase which now include keyboard support
* ClickCounter
* ImageRendering
* TextFormat
And a fourth example for the layouts:
* SimpleLayoutsTest
If something isn't going to be fully supported due to limitations with pxscene, please mention that in the forum and README.
React Native server
It's important that the server still work properly for XRE apps, and that code is properly shared and encapsulated. It's fine to refactor the code if it makes sense to split things out so they can be reused and consumed by either the pxscene piece or the XRE piece.
The server also needs to be able to transparently handle the requests and respond accordingly. This means that a request from pxscene should be responded to with pxscene data, but a request from an XRE server should respond with XRE data. There should be no difference in the React Native code required for an app that runs in either XRE or pxscene.
Pxscene
We are using a framework called pxscene for a number of current projects. You can find more details here:
Recently documentation was added that describes how to integrate Visual Studio code debugger with pxscene for debugging local scripts:
https://github.com/johnrobinsn/pxCore/blob/master/examples/pxScene2d/VSCODE_DEBUG.md
General requirements
The goal of this challenge is to add in new support for keyboard handling and lyouts to our React Native server side flow.
As an overview, when a request is made to an app, like "http://{react-server}/{app_name}", we'll send down Javascript to pxscene that will handle the UI generation based on what the server sends down, and will also send events back to the server. Basically, the Javascript sent down from the server will act similar to how the XRE receiver works, where it sits between the graphics layer and the server, handling events that are sent down from the server, and raising events back up to the server based on user actions.
Keyboard support
We recently added keyboard support to the React-->XRE code. This challenge will expand that integration so that the examples can be navigated properly via the keyboard.
Layout server
A recent challenge implemented basic layout support to the XRE codebase. See commit hash 8c05c61c4a0cdafb41d285310268e0418004549c for an overview of what changed in the React-->XRE codebase. We want to extend the same support to the pxscene app.
Note that the layouts will be static against the size of the pxscene window when the app is launched. We don't expect the app to expand when the pxscene window is resized. The eventual pxscene window will be statically sized at either 1280x720 or 1920x1080 and won't be resized.
Single server
The previous challenge that implemented the main React-->pxscene integration required two servers - one for the server and another to host a basic Javascript redirect that can be loaded in pxscene. That's not what we're looking for - the end goal is a single server that can handle both pxscene and XRE clients. Please make sure that the routing and other pieces are updated to include everything necessary to run this as a single server, with the exact same React Native code serving both XRE and pxscene clients.
Examples
Your submission should support the all examples in the current codebase which now include keyboard support
* ClickCounter
* ImageRendering
* TextFormat
And a fourth example for the layouts:
* SimpleLayoutsTest
If something isn't going to be fully supported due to limitations with pxscene, please mention that in the forum and README.
React Native server
It's important that the server still work properly for XRE apps, and that code is properly shared and encapsulated. It's fine to refactor the code if it makes sense to split things out so they can be reused and consumed by either the pxscene piece or the XRE piece.
The server also needs to be able to transparently handle the requests and respond accordingly. This means that a request from pxscene should be responded to with pxscene data, but a request from an XRE server should respond with XRE data. There should be no difference in the React Native code required for an app that runs in either XRE or pxscene.
Native validation
To prove out the solution, we need to ensure that a native mobile build of an app matches what is displayed in pxscene. Please provide documentation on how to compile each example and run it in Android or iOS, and please also provide this information as part of your submission video. This is already done in the codebase, but we need to make sure nothing gets broken. Ideally, the examples shouldn't have to be changed at all.
Submission
Your submission should be a patch file in Git against commit hash 20e77248f4e576d02ea9e75456b568d3a089adde
NOTE: You are free to change, reorganize, and refactor the code as you see fit. You are not required to stick to any past decisions on architecture.
Please make sure your updated README covers:
1. How to deploy the server-side to Heroku
2. How to configure the client pxscene app to connect to the server and work with the different apps available
3. What the React Native app looks like
A video is required, but it only needs to cover the validation (pxscene and native), not the setup. Having the setup details only in the README is fine.
Links:
https://facebook.github.io/react-native/���
https://www.youtube.com/watch?v=hDviGU-57lU
To prove out the solution, we need to ensure that a native mobile build of an app matches what is displayed in pxscene. Please provide documentation on how to compile each example and run it in Android or iOS, and please also provide this information as part of your submission video. This is already done in the codebase, but we need to make sure nothing gets broken. Ideally, the examples shouldn't have to be changed at all.
Submission
Your submission should be a patch file in Git against commit hash 20e77248f4e576d02ea9e75456b568d3a089adde
NOTE: You are free to change, reorganize, and refactor the code as you see fit. You are not required to stick to any past decisions on architecture.
Please make sure your updated README covers:
1. How to deploy the server-side to Heroku
2. How to configure the client pxscene app to connect to the server and work with the different apps available
3. What the React Native app looks like
A video is required, but it only needs to cover the validation (pxscene and native), not the setup. Having the setup details only in the README is fine.
Links:
https://facebook.github.io/react-native/���
https://www.youtube.com/watch?v=hDviGU-57lU