mikaturunen / phaser-examples-typescript

Typescript versions of hundreds of source code examples and related media for the Phaser HTML5 Game Framework
34 stars 9 forks source link

Discuss: phaser-examples - do we want to do a full sync? #39

Open mikaturunen opened 8 years ago

mikaturunen commented 8 years ago

I was working on doing a full sync on a local, separate branch today and much to my own demise, setting up the phaser-examples locally and running the examples.. not so fun anymore. It felt next to impossible without spending too much time into it.

Current test scenario:

git merge upstream/master # this being the phaser-examples repo
resolve merge conflicts 
install grunt php + php5
run grunt php and navigate to localhost:8001/examples
it automatically moves me to phaser.io/examples website without allowing me to locally see the examples anymore

I suppose there's a way to work with them locally but I didn't spend too much time on it. The phaser-examples repo has taken in a PHP approach on essentially saying "please, use the examples at phaser.io/examples and don't run them locally", as far as I've understood. Which is completely okay in my opinion to be fair.

So how do we want to handle the sync to latest phaser example repo?

  1. Do we merge the repo here fully and lose the ability to run the typescript examples locally with npm connect, essentially loosing all the advantages of the repo (one of the main reasons I made this repo was to see the examples and how they were written in TS inside my browser).
  2. Do we aim to target latest Phaser version, update the examples manually and stay with the old style of the example page that allows us to view the page and examples with the ts code?

What we obviously could do is to diverge the website even more and create fully customized phaser-examples-typescript website that's online all the time.

The problem has two stages:

We can obviously handle the phaser-examples how we want and I'd say we just do manual merges and keep working that way and update to latest Phaser as we go along. But the website, how do we want to handle it? I would currently advice against merging the phaser-examples website side to our repo.

How does everyone else feel about this? @JamesSkemp, any input?

mikaturunen commented 8 years ago

And while we are at it, I think if we are going to start diverging the website further we probably should move all the typescript examples from the original examples and into something like ./examples/typescript and have the website point to there to load them.

That would require minor work on the website, nothing big and would allow us to merge the changes from the original JS examples into their proper folder and see what have been changed in an easy fashion.

JamesSkemp commented 8 years ago

Is it safe to assume that users interested in this repo would also be using Visual Studio?

If so, what about the option of creating either Razor or ASP.NET pages to pull in the examples, in a way similar to how the PHP functionality was pulling these?

That might allow the repo to continue to be useful for local purposes, without having to create a website to host the TypeScript examples.

With Lazer/Phaser 3 possibly coming in the next 3-4 months, having a future plan would be a good idea.

mikaturunen commented 8 years ago

Also while I was looking at one of the random examples of the "newer" website: http://phaser.io/examples/v2/animation/change-frame

They've started allowing inline editing of the code inside the embedded code view. I would love to retain that functionality but if we sync the website I'm afraid we are in for a hell of a ride, as instead of showing JavaScript, we would be showing TypeScript and allowing TypeScript inline editing. Not impossible but can get quite annoying.

Man.. this might need some actual thinking.

mikaturunen commented 8 years ago

Oh and relating to the Visual Studio comment, I'd rather see the user using OS alternatives like Visual Studio Code instead of the full suite, or other available editors like Atom, Eclipse with TypeScript plugins, SublimeText etc. So locking onto a IDE specific solution might not fly too well with the whole open source side of things.

mikaturunen commented 8 years ago

So I think it's at least easy to agree on this one:

This is essential and the whole point of this repository.

Then onto to the next detail:

  1. Do we need phaser-examples style website? If so, do we sync it + do set of changes.
  2. Do we keep going with what we've got
  3. Do we do something custom?

My head explodes when I think about this. I suppose one option is to completely strip out the website portion of the repository and focus maintaining TypeScript examples only? That sounds quite far fetched but is definitely in the realm of possibilities. I mean we are not trying to compete with Phaser, we are just trying to provide a solid TypeScript example set.

JamesSkemp commented 8 years ago

Lot to process, so ...

And while we are at it, I think if we are going to start diverging the website further we probably should move all the typescript examples from the original examples and into something like ./examples/typescript and have the website point to there to load them.

I actually think this is a good idea, either way. True, it would make it a little more difficult to see what examples are missing, but it would make for a nice clean separation.

They've started allowing inline editing of the code inside the embedded code view. I would love to retain that functionality but if we sync the website I'm afraid we are in for a hell of a ride, as instead of showing JavaScript, we would be showing TypeScript and allowing TypeScript inline editing.

Version future+1. :)

Oh and relating to the Visual Studio comment, I'd rather see the user using OS alternatives like Visual Studio Code instead of the full suite, or other available editors like Atom, Eclipse with TypeScript plugins, SublimeText etc.

Visual Studio Code supports Razor, I believe (and a Google search seems to confirm that), so I'm good with that.

Much like the examples/typescript directory addition, perhaps support for alternate front-ends would be nice? I have little desire to install PHP on this machine, so I think either way I'm going to look at creating some sort of Razor-based front-end in the coming weeks.

Then onto to the next detail, do we need phaser-examples style website? [...]

Past experience has taught me that the best question to ask when this question comes up is whether or not you want to maintain something like that. Getting updates to this repo is one thing, but it's another to setup a site on a server somewhere.

Unless there's a generator that could be used, like those that will generate blogs, to create static files based upon the contents in this repo, and then piggyback off of GitHub Pages.