rojo icon indicating copy to clipboard operation
rojo copied to clipboard

DON'T MERGE: User plugins proposal and prototype

Open blake-mealey opened this issue 3 years ago • 0 comments

This is a proposal and prototype implementation for a solution to #55.

The goal with this PR is primarily to receive feedback on the proposed design document. If we can come to a consensus on the design, I would be happy to start submitting PRs to start the implementation of it.

Please see the included PLUGIN-DESIGN.md file for the proposal, and the code changes for the prototype. To try the prototype locally, you can build/serve/whatever the project test-projects/plugins project (e.g. cargo run build test-projects/plugins -o test.rbxlx).

The implementation is very prototypesque and not the cleanest code, and does not fully implement the proposed design. My goal with it was primarily to validate that the proposal is reasonable to achieve given the internal implementation of Rojo which I didn't understand previously. I consider this to be validated.

The prototype implements the following parts of the proposal:

  • The new top-level plugins field of the project file (both raw strings and objects with source and options fields), but not URL sources
  • Plugin environment and loading mechanism (only local plugin files can be loaded)
  • Minimal plugin instance hooks (only supports the middleware and load hooks)
  • Minimal plugin library (only inlcudes the readFileAsUtf8 function)

Thanks!

blake-mealey avatar Oct 28 '21 22:10 blake-mealey