gabrielflorit / script-8.github.io

A JavaScript-based (React + Redux) fantasy computer for making, sharing, and playing tiny retro-looking games.
https://script-8.github.io/
MIT License
646 stars 35 forks source link

Simplify getting started #149

Closed svenefftinge closed 5 years ago

svenefftinge commented 5 years ago

Cool project! 🎉 This PR just adds a config and button to allow people playing around immediately. It uses Gitpod, a free online dev environment for Gitpod we have been working on for the path months. It allows for easier contributing to the project and generally playing around with script-8.

I configured it so that it automatically opens two terminals with

similar as you described for the local setup.

screenshot 2019-01-27 at 08 51 23

Try it out:

Open in Gitpod

gabrielflorit commented 5 years ago

Interesting, hadn't heard of this before. I tried clicking the link but nothing happened. Maybe I made a mistake?

svenefftinge commented 5 years ago

You mean you clicked the button in above's comment? Very strange it is a regular link. Just tried it again and it works for me. You can open any github repo by just prefixing the github URL.

For instance this PR: https://gitpod.io/#https://github.com/script-8/script-8.github.io/pull/149

What browser are you on?

svenefftinge commented 5 years ago

There was an issue with a CDN which only some users experienced. It has been fixed.

gabrielflorit commented 5 years ago

Well, this is an impressive project. Some neat magic going on here. I have some questions:

I have some further testing to do, but nice work.

svenefftinge commented 5 years ago

The button I shared here is a snapshot, i.e. a copy of a certain state. The button in the readme will always use the master state.

Gitpod will always use the context that is provided, through the prefixed URL. E.g.:

gitpod.io#https://github.com/script-8/script-8.github.io -> dev (default branch) gitpod.io#https://github.com/script-8/script-8.github.io/tree/compressmap -> compressmap gitpod.io#https://github.com/script-8/script-8.github.io/pull/149 -> my branch from my repo (i.e. this PR)

It also works on issues in which case gitpod creates a local branch GH-<issue_nr> that is branched from the default branch (dev in the case of this repo).

how do I open a url with query params?

Could you elaborate what you mean?

gabrielflorit commented 5 years ago

Could you elaborate what you mean? A common workflow with this project is loading cassettes for debugging. This is done by specifying the cassette id, like this: https://script-8.github.io/?id=cd8d6811adb3afb472aaf7505729cf01

Is this possible?

svenefftinge commented 5 years ago

Sorry, I was travelling last week. Yes, it is. You can open any URL using the Preview: Open URL command (press F1 for the command palette). Also Gitpod has a CLI, that allows to open the preview from the terminal, so in case the cassette id is known programmatically one could execute something like this:

gp preview $(gp url 3000)?id=$CASETTE_ID

Let me know if you want me to reopen the PR. I will be happy to help out in future if you have more questions.