Use hash based renaming for dependencies#3
Merged
Merged
Conversation
Member
|
Thanks @mikolalysenko! This looks super promising. Unsure what's causing macros not to be renamed, I believe that was working previously? It would rename any macros that weren't in the entry file. I'll review over this weekend and keep you posted :) |
Member
|
631d817 made macro renaming work before :) |
Contributor
Author
|
@hughsk thanks, all fixed now. |
Contributor
Author
|
Maybe in the future it might make some sense to scope macros to individual files so that they don't leak out of a particular module. As a hack, one way we could do this is just stick a bunch of |
* Use standard formatting * Use shallow-copy instead of JSON.parse for cloning tokens * Update test names * Pull in murmurhash3_gc directly to save on bundle size
hughsk
added a commit
to glslify/glslify
that referenced
this pull request
Dec 6, 2015
Most notable is glslify-bundle@4. See also: glslify/glslify-bundle#3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch implements content based renaming for dependencies. So instead of giving variables names like:
Light_2_3_4_..., the new naming scheme renames variables toLight_<hash>wherehashis a hash of the dependency index and the arguments to the bundle. This reduces code duplication due to nested dependencies and also makes reusing structures between modules (as in the complex dependency case) easier to do.One problem right now though is that preprocessor macros aren't renamed. I think that this is a bug in glsl-descope-tokens, but I'm not sure. @hughsk or @mattdesl: Do you know how glslify-bundle handled renaming macro tokens (like
#define PI 3.14...) previously?