sprig: file, run, hide and watch URL params missing in the new editor

file

Since the new editor doesn’t load games from files, would it be possible to:

  1. Create a game from a remote file (https://sprig-beta.hackclub.dev/~/new?file=<xyz>)
  2. Load a game from a file without saving, as if the user is logged out (https://sprig-beta.hackclub.dev/editor?file=<xyz>)

Potential behaviour if the user choses to modify the file is to either create a new game for the user, or to not store changes. Ideally this should be toggleable

watch, hide, run

v1 PR: https://github.com/hackclub/sprig/pull/644/files

  • run=true can be set to run the code given in file immediately
  • hide=true can be set to not show the editor, just the run window
  • watch=X can be set to refresh the file param every X milliseconds Each of these params require file= to be set

Example:

https://editor.sprig.hackclub.com/?file=http://localhost:3000/build.js&run=true&hide=true&watch=1000

This will reload the file from http://localhost:3000/build.js every second (if it has changed), while also immediately rerunning it, and not displaying the editor

I’m not familiar with the new codebase yet, but I might add these myself later if no one picks it up

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (14 by maintainers)

Most upvoted comments

Okay, I think we have all the info we need here to promote this to the work queue, thanks @khrj @kognise @leomcelroy

It’s intentional we don’t support multi file projects out of the box. We want the submitted games to be self-contained and useful for beginners to read, so we chose not to support tools for developing large projects. The way @khrj set it up is a good solution. If you want to make a more involved Sprig project (which is great) migrate to your own ide. A simple file import can be the only needed escape hatch.

I broke out Sprig as separate library months ago upon request by people to use it in game jams, but never finished publishing it to NPM because I was unsure how to structure the repos. I’m very supportive of having the game library published. The main thing that is lost is the asset editors when working outside our editor, but one can always use them to draw assets and then copy them into their local IDE. As a short term solution let’s make a page with the behavior @khrj is requesting. Lexi let’s talk separately about publishing the Sprig engine.

Alright then, if more complex toolkits are out-of-scope for the web IDE (which I get the reasoning behind), would it be possible to revive the old params?

Yes @khrj - That is the plan RE: this issue. I have also increased the priority of this issue as it is a regression.

@khrj You make very good points. Please keep in mind that I’m not necessarily suggesting this as a feature you specifically would need to implement, but seeing as you have a very real use case here that might well apply to others as well, I thought I’d bring up “official support” as a conversation point alongside the integration that it seems you were relying on which is now broken.