The Problem
XRPCode serves as a nice and intuitive editor for kids. However, the Blockly portion of XRPCode is heavily limited by the number of blocks available for use: for instance, it would not be possible for me to easily use Blockly to create an OLED display without adding more blocks(as @WayneSeltzer wanted in an earlier post, for example). Of course, some problems with this include overbloating the XRP with driver files for dozens of parts, even ones that most students may not have, as well as managing the installation of all of these files and addition of these blocks onto the XRPs of each student. In addition, knowing HOW to make new blocks(such as how @KWOL wanted to make a new sensor block) requires some reading into blockly and how XRPCode is set up.
This made me want to create a solution for this problem: one that would allow people to not only easily share new libraries and blocks, but also easily configure the libraries installed onto the XRP without much bloat.
My Solution: The Mod Manager
My solution for this problem was to take inspiration from the similar issue in gaming: I wanted to create a tab that would allow you to easily install “mods” onto the XRP, each one adding both new blocks and potentially python dependency files. The user would be able to select which mods are installed, and these mods would persist in local storage so that the user doesn’t have to reinstall them constantly.
After some development, I have created a (somewhat) working prototype of this manager! It is accessed through the file tab, and allows you to install mods(currently placeholders).
Mods are categorized in folders for easy use, and can be configured to be dependent on other mods being installed as well.
Currently, after saving installed mods and creating a new Blockly editor, the new blocks appear and can be used! (note: they only appear in new Blockly editors, it’s a known bug of the mod manager).
In addition, python dependencies are automatically installed in the lib/mods folder(will add a progress bar and stuff for this soon). However, you need to reload to see them be added.
Mods can be removed as well, but they require reloading the website after removal(known bug).
Adding mods to the manager requires updating the source repository of my fork of XRPCode. By adding folders to the mods folder, new dependencies can be added. They follow the format of containing blocks.js(adding the new blocks), python_blocks.js(adding the python code of the new blocks), toolbox.json(formatting the blocks for being added), and optionally deps.json(for adding other mods as deps) and a deps folder with python dependency files. I may make a visual editor that makes the process of adding mods easier in the future.
The manager is far from being complete (it’s VERY unoptimized), and I still need to add the actual mods themselves to be downloaded. However, the current working version is available at Roboloco’s fork of the XRP Code Editor with two dummy mods if you want to see how the manager functions(if the site asks you to update library files, press cancel, otherwise it breaks). The source repository can be found at this link. If you want to contribute to this project, leave a comment in this post asking to do so! I hope you guys find use out of this project!