modularize.js: Enable example dependencies. #16477
Merged
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.
With this PR, it's now possible to convert modules like
ColladaLoaderthat have dependencies to other modules. Interestingly, the new code revealed a bug in the module ofShadowMapViewersinceUnpackDepthRGBAShaderis no part of the core.The PR implements the suggestion mentioned by @mrdoob here: https://github.com/mrdoob/three.js/pull/16400/files#r284492725
It introduces per module an array that represents the dependencies to other example files. Per entry there is a key/value mapping that looks like:
classname=>path to module. In this way, it's very flexibel to define dependencies since you not have a 1:1 relationship between class name and module name. E.g. it's now easy to define thatPassshould be loaded fromEffectComposer.jswhich would be not possible to derive only from code.