-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Replace glslify with brfs #236
Conversation
Improve DX by enabling hot reload of vertex and fragments shaders. Ease usage outside of Browserify. Related to #231.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for taking this on!
Let's just be consistent with how we import things across layers before we merge.
@@ -13,5 +13,5 @@ TODO | |||
_docs | |||
examples/winds/data/*.html | |||
node_modules | |||
npm-debug.log | |||
*.log* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe this wildcard is a little bit too general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum yeah npm-debug.log
sometimes gets suffixed with numbers, maybe *.log.*
would be better.
|
||
const glslify = require('glslify'); | ||
import {Layer, assembleShaders} from '../../../../../../index'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Why are we moving this import line down? I think we should follow a logical ordering when including files (e.g. our own code first, then our own modules, then standard modules).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it interesting to separate vendors modules from project source files, this way we know for sure what belongs is a dependency or not. Might be obvious right now because of the relative url but I would like to use absolute one in a near future, so I'm just laying to fondations.
import {Model, Program, Geometry, glGetDebugInfo} from 'luma.gl'; | ||
|
||
const glslify = require('glslify'); | ||
import {Layer, assembleShaders} from 'deck.gl'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe have deck.gl
before luma.gl
? Higher level to lower level import order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
luma.gl
being a dependency of deck.gl
, I find it more logic to put luma first.
|
||
const glslify = require('glslify'); | ||
import {Layer} from '../../../lib'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are imported differently in other layers (using single import line), let's be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any example? Don't see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second file in this diff...
import {join} from 'path'; | ||
import earcut from 'earcut'; | ||
|
||
import {Layer} from '../../../lib'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, order and combine imports
import {GL, Model, Geometry} from 'luma.gl'; | ||
import {join} from 'path'; | ||
import {readFileSync} from 'fs'; | ||
|
||
import {Layer} from '../../../lib'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order and combine imports
import {join} from 'path'; | ||
import earcut from 'earcut'; | ||
|
||
import {Layer} from '../../../lib'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
Wouldn't an alternate approach be to prebuild and tell webpack users to rely on the prebuilt version? That seems to be common (mapbox-gl-js does this). Unrelated, but if glslify is kept in then you can use this https://github.com/hughsk/glslify-optimize |
@contra The issue was that even if relying on the builded and minified version of I can look into integrating the |
516e5ef
to
fff5fbb
Compare
fff5fbb
to
1d652ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Thanks.
Improve DX by enabling hot reload of vertex and fragments shaders.
Ease usage outside of Browserify.