KhronosGroup / WebGL

The Official Khronos WebGL Repository
Other
2.65k stars 670 forks source link

Create a separate, tiny repo for webgl-debug.js #1015

Closed backspaces closed 9 years ago

backspaces commented 9 years ago

In the olden days, we just downloaded webgl-debug.js where ever we could find it. Manually. Often scraping out of a online-document and creating a file for it.

Fast forward toward modern modular systems, and es6 modules. These provide simple, one-step installation of modules.

In particular, using jspm, the javascript package manager (http://jspm.io/), this is how apps access webgl:

import webglDebug from 'webgl-debug';

jspm install webgl-debug=github:KhronosGroup/WebGL -o "{main:'sdk/debug/webgl-debug.js'}"

and access it from es6 apps by:

import webglDebug from 'webgl-debug';

But, because the WebGL repo has many sub-repos, this results in a large download by jspm:

66M KhronosGroup/

The WebGL repo needs to be refactored, or at least the webgl-debug.js have its own repo, either on github or npm.

kenrussell commented 9 years ago

Thanks, this is a good point.

What should the new repository be named? WebGLDebug seems overly specific. WebGLDeveloperTools? It'll contain a sub-portion of the sdk/ directory.

There are downsides to factoring out this code into a separate repository, but I agree it could make this and potentially other libraries easier to use during development.

backspaces commented 9 years ago

Hey, thanks for the fast reply!

As long as its primarily developer tools, all of which are likely to be used by most users of webgl-debug.js, it seems reasonable to have a single WebGLDeveloperTools repo.

But with the advent of SPDY/HTTP2 and "micro module" design, the smaller the better.

To get a feel for how much refactoring is going on, check out stack.gl (http://stack.gl/). They have even taken toji's glMatrix and factored it into mat2, mat3, mat4, vec2, ... I first thought I was misunderstanding, but yep, that extreme.

In fact, they have each function under mat4, as separable modules! I thought it was nuts until I saw what they could do with it. Sorta the "un-framework". Slightly spooky.

Currently, with es6 and "bundling", you can literally create a app.js file with only the modules you actually call on. It is considered an anti pattern for the future, where SPDY/HTTP2 will be able to do micro async script loading.

I'm still trying to get my head around it. You may want to watch Guy Bedford's talk on the jspm website. https://www.youtube.com/watch?v=szJjsduHBQQ He articulates pretty well what we expect shortly, with es6 having modules and es7 having async functions.

Its a brave new world!

kenrussell commented 9 years ago

https://github.com/KhronosGroup/WebGLDeveloperTools has been created, containing webgl-debug.js and related files for the time being. It has been installed as a submodule into the WebGL repository under sdk/devtools/. Thanks for the idea.

backspaces commented 9 years ago

Thanks! We plan to use this for Ed Angel's MOOC based on his textbook, so this is really nice. (Ed's a local)

On Wed, Jun 3, 2015 at 1:22 PM, Ken Russell notifications@github.com wrote:

https://github.com/KhronosGroup/WebGLDeveloperTools has been created, containing webgl-debug.js and related files for the time being. It has been installed as a submodule into the WebGL repository under sdk/devtools/. Thanks for the idea.

— Reply to this email directly or view it on GitHub https://github.com/KhronosGroup/WebGL/issues/1015#issuecomment-108587022 .