Move ctor param info from global map to metadata. Fixes #161 #204
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.
Hi there.
This PR moves the paramInfos acquired by the
injectable()
decorator from the global typeInfo map to constructor/class metadata.That fixes a
TypeInfo not known for ...
bug occurring in an environment where a library with injectable dependencies is linked using symlinks (npm-link).In this special environment, globals are not shared between the library and the main project, therefore the typeInfos populated by the injectable() decorator weren't accessible before to the main project.
Due to this unfavorable side-effect of the npm-link, the
registry()
andautoInjectable()
decorators will still be broken because their functionalities require direct access to the global container instance.Minimal repo reproducing the issue in the initial commit: https://github.com/florian-g2/npm-link-missing-globals