-
Notifications
You must be signed in to change notification settings - Fork 20
Description
The client has asked us to implement a compile-time switch that compiles pxscene either with duktape used as the JS engine or Node.
This is the main chunk of work for this challenge. The final goal is to have some minor build tweaks and a host of new files, with no existing files changes, to support duktape. This would allow us to not affect anything with the node implementation with the duktape work.
Node implementation
The "Node" implementation will be the default.
If the "Node" switch is given at compile-time, the app should work exactly as it does now. It should compile with Node support and all existing examples and code should work as expected.
If Node is used, then duktape / dukluv will not be compiled or linked into the final pxscene executable.
duktape implementation
The duktape implementation will be switchable for the pxscene build. If duktape is used, then Node will not be compiled or linked into the final pxscene executable.
File layout
Duktape / dukluv includes a number of new files. These need to be in appropriate folders in the source tree. src/dukluv is a good example of what we would like to do. There are a number of files added to /src that need to be moved out to a separate folder to keep things organised.
The same applies to new JS files that are needed for duktape. Things like fs.js, http.js, punycode.js, etc... should be in a separate "duktape" folder underneath examples/pxscene2d/src and should only be included in the final executable if the duktape switch has been set at compile time.
The same new src/duktape folder should contain rtNode, rtNodeThread, rtObject, and rtPromise files that will be used instead of the existing Node versions, when duktape is selected at compile time.
Note that we also want a src/jsbindings/duktape folder added to contain the updated rtFunctionWrapper, rtJsModules, rtObjectWrapper, and rtWrapper files that are changed for duktape vs. Node
Suggestions
If you can think of a cleaner and / or easier way to support being able to build pxscene with either Node or pxscene, please post in the challenge forum.
The client's end goal is to have as few changes to the existing Node implementation as necessary, with the duktape support coming through different files at compile time.