0

As a jQuery user, I link the remote library from Google using

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

which is very clever because it's already loaded in the brower cache if the reader visited another site that did the same.

As I discover Phaser, I was hoping to see people on the web doing the same with

<script src="https://raw.githubusercontent.com/photonstorm/phaser/master/build/phaser.min.js"></script>

or any library hoster, but apparently no one does.

Is there a reason why Phaser users don't do that?

SteeveDroz
  • 6,006
  • 6
  • 33
  • 65
  • 1
    Have a read through http://stackoverflow.com/questions/8779197/linking-files-directly-from-github – exussum Aug 08 '14 at 08:53

2 Answers2

8

I would strongly advise against linking to the master release as it will absolutely break your games over time. Most of the 2.0.x updates have been non-API changing, but 2.1 and above will be altering some core aspects of Phaser. You should only ever link to specific versions.

For a similar service to the Google hosted APIs (of which they only host very specific libraries that they've selected) we use CDN.js, which offers the same thing. You can find details in the Phaser README or just go to http://cdnjs.com/ and search for Phaser.

PhotonStorm
  • 3,325
  • 14
  • 17
1

There is as such no issue if you link to a specific version. But you don't want the latest build, as this can potentially break your site by making changes.

I don't know Github's policies on referencing their site like this.

Troels Larsen
  • 4,462
  • 2
  • 34
  • 54