- 545de07: add
setParent
method. Child container can set parent container connection
- c9b67ea: remove resolve method second parameter (options - context)
- f814cd6: Remove
beforeResolve
andafterResolve
callbacks. After some time I figured that these hooks are an antipattern when it comes to the dependency injection (and are rarely used), therefore they are being removed. - 634db4a: remove
unbind
hook. After some time I have found that the unbind hook is an antipattern and I do not want to support it anymore. - 867d760: remove
transform
utility function. Another anti-pattern.
- 076812a: remove
clearInstance
andclearAllInstances
methods.
- 9390bf1: create
registerInjections
helper function for an easier way to register dependencies for a class or a function - 03e55af: Add container
lock
method.
- 6ba17d1: add comments to public methods
- 509c64d: Add documentation for the
validate
andvalidateSafe
methods.
- c72533b: This PR implements two new methods on the pumpit class validate and validateSafe. These methods check if dependency keys that are used for injection are present in the container. It will not instantiate any classes or run factory functions.
The
validate
method will throw an error if the tree is invalid, while thevalidateSafe
method will return an object indicating whether the tree is valid.
- 4cfbc46: Implement using special "INJECT_KEY" symbol instead of "inject" key property
- 61a361f: instances created via "child" method can also have a name
- c470983: Optionally give instances custom names.
- c7e4157: ts config import issue
- 516e684: run biome check on all source files
-
e2c941d: refactor package export fields to include separate require statements.
closes Support --moduleResolution node16 in typescript #38
more info on the problem: https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseESM.md
- 27f4119: update readme
- fd2f690: add class inheritance documentation
- 0a3e663: mark package side effects free
- 073c0b8: remove circular dependency functionality
- e92fde3: remove the possibility to inject dependency as array of dependencies
- 4324109: switch to vite build process
- af829ec: update readme
- 6fb62fa: Remove bind key check. This will not check if the bind keys passed to the
bindFactory
are correct. - 5669230: Implement
postConstruct
method that will be automatically called if it exists on the class.
- cb7c7b7: fix unbind falsy values
- 0bbcf2c: fix: Singleton values are not properly resolved on multiple resolve calls.
- fef839d: update docs
- 0e346fb: chore: update README
-
5eef060: Change method name
-
a20b69b: Implement
clearSingleton
method.It enables clearing a single singleton by key.
-
1d024dc: Rename methods.
clearAllSingletons
is renamed toclearAllInstances
clearSingleton
is renamed toclearInstance
-
42309c6: Introduce new scope:
SCOPE.CONTAINER_SINGLETON
. This is similar to regularsingleton
scope, but if a child container is made, that child container will resolve an instance unique to it.Remove "
shareSingletons
" option fromchild
method. This is no longer needed since the newSCOPE.CONTAINER_SINGLETON
replaces this functionality.
- 3e372cb: Change function signature for "beforeResolve function"
- ec70e5a: Change function signature for "onBefore"
- 84c44d2: Implement object value registration for class and factory binding.
- bbb3f6b: Rename all the files and code from "Pumpa" to "PumpIt", since NPM doesn't allow me to use "Pumpa" as it is too similar to "pump" package.
- 2af26f2: Add option for custom data to be passed to the
beforeResolve
andafterResolve
callbacks.