This change introduces a more robust system for supporting simulator extensions, making it possible to support third-party extensions (though such extensions must be approved by the team).
Summary of changes
New config section in targetconfig.json
Entries in the existing approvedRepoLib map have a new subsection called simx. This is used by both the client and the backend to specify and serve simulator extensions. See SimulatorExtensionConfig in localtypings/pxtarget.d.ts for specifics.
New config section in pxtarget.json
To support testing new or updated 3rd party simulator extensions before they go live, I've added a testSimulatorExtensions section to pxtarget.json. This allows simulator extensions to be configured in an upload target.
New URL parameter for local testing
To support local simulator extension development, I've added a new URL parameter called simxdev. Including this parameter will cause simulator extensions to be loaded from their configured devUrl (only applicable when serving the target locally).
pxt serve changes
Added a new optional parameter to pxt serve called backport. It takes a port number where the locally running backend is listening (typically 8080). This is used to proxy simulator extension requests to the locally running backend. Simulator extensions are not loadable through pxt serve directly due to the complexities of syncing the extension's repo/branch/commit sha. This approach was simpler, and it enabled simultaneous local testing of frontend and backend changes. It works in concert with a new backend setting called LOCAL_SIM_PORT, which I will document in the backend repo. I doubt anyone will ever need to use this :)
This change introduces a more robust system for supporting simulator extensions, making it possible to support third-party extensions (though such extensions must be approved by the team).
Summary of changes
New config section in targetconfig.json
approvedRepoLib
map have a new subsection calledsimx
. This is used by both the client and the backend to specify and serve simulator extensions. SeeSimulatorExtensionConfig
inlocaltypings/pxtarget.d.ts
for specifics.New config section in pxtarget.json
testSimulatorExtensions
section topxtarget.json
. This allows simulator extensions to be configured in an upload target.New URL parameter for local testing
simxdev
. Including this parameter will cause simulator extensions to be loaded from their configureddevUrl
(only applicable when serving the target locally).pxt serve
changespxt serve
calledbackport
. It takes a port number where the locally running backend is listening (typically 8080). This is used to proxy simulator extension requests to the locally running backend. Simulator extensions are not loadable throughpxt serve
directly due to the complexities of syncing the extension's repo/branch/commit sha. This approach was simpler, and it enabled simultaneous local testing of frontend and backend changes. It works in concert with a new backend setting calledLOCAL_SIM_PORT
, which I will document in the backend repo. I doubt anyone will ever need to use this :)