Releases: pcafstockf/async-injection
Fix "exports" in package.json
Fix package.json exports #18.
Thanks to @IvanLi-CN for finding this, and the solution.
Breaking API change (improved imports).
This release aims to shorten and simplify imports from async-injection
.
A design goal of this project has always been to provide a minimal API surface of the most commonly used classes from index.ts
, but still allow you to import less frequently used functionality from submodules.
However, due to the way the dual module cjs/esm support was done, submodule imports looked ugly, and while they worked, they could also be somewhat misleading.
import {INJECTABLE_METADATA_KEY} from 'async-injection/lib/cjs/constants';
// The above works even in an esm project!
This release moves the TypeScript typedefs up from inside lib/cjs/*
and lib/esm/*
to just lib/*.d.ts
(and adds a ./* export in package.json).
Put simply in code, you can now just write:
import {INJECTABLE_METADATA_KEY} from 'async-injection/constants';
The interfaces in binder.ts
turned out to be rarely used, so that submodule export has been dropped from index.ts
. You can of course still import any of them using a submodule reference (e.g. 'async-injection/binder').
Ultimately the underlying JavaScript code is unchanged, but hopefully these typing changes will make things a little easier and more intuitive.
Improved handling of Reflect meta-data
Minor tweaks and updates
- Backwards compatible binder api updates.
- Update patch level dependencies.
Improved class constructor parameter type recognition
- Improved handling of class constructor parameter type recognition.
- Update dependencies.
Fix esm issues
Updated docs
- No code changes.
- Updates to docs for consistency across projects.
devDependencies update
- Update devDependencies.
- Update github workflows.
- Update badges in main ReadMe.
- Add support directory.
Container cloning
- Add experimental ability to clone a Container (see Container.clone JSDoc comments for details).
- Fix error handling callback to pass instantiated object when construction succeeds but post construction fails.
- Reformat code project wide (based on IntelliJ formatting options).
Support optional typing for interfaces and constants
- Add Angular style InjectionToken class as a variant of InjectableId to support implicit typing of constants and interfaces.
- Minor update to Binder.resolveSingletons to make it chainable (aka return the Container/Binder instance).
- Minor updates to ReadMe.