Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer some type of distributable bundle #21

Open
cvan opened this issue Aug 2, 2015 · 4 comments
Open

Offer some type of distributable bundle #21

cvan opened this issue Aug 2, 2015 · 4 comments

Comments

@cvan
Copy link
Contributor

cvan commented Aug 2, 2015

Though I'd be hesitant to introduce a Node + npm + Browserify stack to such a simple, straightforward project, it might be the best step forward to allow people to integrate the eleVR Web Player in their projects with minimal friction.

There could be

  • a watcher for development: every time a file is changed, the bundle would be regenerated.
  • tagged versions: whenever there are changes that are significant enough to warrant a new version of the player, a git tag (and npm version) could be published.
  • modules referenced by npm: instead of having to manually integrate third-party libraries (such as glMatrix), it'd be nice if dependencies were managed via npm (the dependencies would be referenced from the project's package.json), which would make versioning easier (and shrink the codebase in this repo).
  • a downloadable/referenceable bundle: many OSS projects have a dist/ directory, which contains the combined JS bundles, concatenated and all. every time a commit is made or a PR is merged, the dist/ directory isn't touched. only when a major version (i.e., a tag) is made is there a new version of the dist/ files created. lots of projects have like dist/bundle.js and dist/bundle.min.js. it's easier for folks to just grab these files and get up and running. (and even better would be to have some service like cdnjs.com actually host the files too, so folks can just link directly to the scripts.) a good example of this practice that comes to mind: https://github.com/jakearchibald/es6-promise
@hawksley
Copy link
Owner

hawksley commented Aug 6, 2015

Hmm. My first intuition is that this seems kind of overkill for what is really a pretty simple project. Although, it does seem like it is slowly gravitating towards getting bigger and more complicated over time.

@hawksley
Copy link
Owner

hawksley commented Aug 6, 2015

I guess it's also worth noting that I don't know how popular this project actually is, and what most users want. Is your intuition that this is something that most people would want?

@hawksley
Copy link
Owner

hawksley commented Aug 8, 2015

After some discussion, I'm good with going for this. Obviously, showing up on the issues page means that it's something that at least some people want and there are definite benefits to making the player easier for people to use. :)

@cvan
Copy link
Contributor Author

cvan commented Aug 11, 2015

Was just thinking about this, and I think a good first step (or compromise) would be to introduce a basic module import system like AMD. So the <script>s in the index.html would remain as is; the only changes required that come to mind:

  1. the addition of a loader file called like amd.js
  2. js/elevr-player.js would become the main "runtime" file that loads all the necessary dependencies
  3. wrap each JS file's contents in a define(…) function call (every file except lib/gl-matrix.js which can continue to be a global)

This would help reduce exposed globals, improve circular dependency issues.

Could use something like Require.js, but it seems like overkill for this project atm. Examples of a simple AMD solution I was thinking:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants