Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise (Lazy) Support + Global onActivation/onDeactivation #1132

Merged
merged 77 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e6fc8de
potential appveyor fix
parisholley Aug 22, 2019
64cec27
fix for Microsoft/TSJS-lib-generator#559
parisholley Aug 22, 2019
4fc0636
Merge branch 'appveyor' into TimerHandlerFix
parisholley Aug 22, 2019
44c314d
full promise/async support, global onActivation/onDeactivation, bindi…
parisholley Aug 22, 2019
3e5b70e
appveyor works again?
parisholley Aug 22, 2019
2e14955
latest versions of FF require latest launcher to not hang
parisholley Aug 23, 2019
72949c0
Merge branch 'appveyor-fix' into async-v2
parisholley Aug 23, 2019
b1e4ff8
chore(package): update publish-please to version 5.5.0
greenkeeper[bot] Jun 30, 2019
c1f887d
fix for Microsoft/TSJS-lib-generator#559
parisholley Aug 22, 2019
2d7d794
latest versions of FF require latest launcher to not hang
parisholley Aug 23, 2019
f1971a4
context bug
parisholley Aug 23, 2019
4bde848
merged with master
parisholley Aug 24, 2019
29e6448
merged with latest
parisholley Aug 24, 2019
40a7951
support promise retying
parisholley Sep 12, 2019
cfe6661
change promise checks to thenable checks
parisholley Sep 15, 2019
1f97c3a
fix dangling promise
parisholley Sep 15, 2019
3ac344d
take advantage of type narrowing
parisholley Sep 16, 2019
cafe1eb
Merge branch 'master' into async-v2
parisholley Sep 16, 2019
a11d135
export predestroy
parisholley Sep 26, 2019
5995443
fix when promises are rejected and null values end up in the cache
parisholley Dec 6, 2019
54fa585
Merge branch 'master' into async-v2
dcavanagh Dec 16, 2020
7f9171c
Merge remote-tracking branch 'origin' into pr/parisholley/1132
PodaruDragos Mar 3, 2021
97207c3
fix failing ci
PodaruDragos Mar 3, 2021
9d745ca
test(resolution): remove additional spaces
notaphplover Apr 6, 2021
01941fd
Bump elliptic from 6.5.3 to 6.5.4 (#1298)
dependabot[bot] Mar 10, 2021
525007b
constant value / function binding activated when resolved (#1122)
notaphplover Apr 12, 2021
a67b3a7
Apply middleware when Container.resolve - fixes 1128 (#1129)
tonyhallett Mar 30, 2021
c1e7376
Setter injection without cast (#1152)
tonyhallett Mar 30, 2021
80e91bd
feat: refactor Container extracting logic to _preDestroyBinding and …
notaphplover Apr 8, 2021
8e77c51
refactor: updated several modules to pass codeclimate's analysis.
notaphplover Apr 8, 2021
1c5d462
Merge branch 'master' of https://github.com/inversify/InversifyJS int…
notaphplover Apr 12, 2021
b74cfd4
Merge remote-tracking branch 'upstream/master' into async-v2
notaphplover Apr 13, 2021
08ad622
refactor: update error messages to not to receive any type parameters
notaphplover Apr 14, 2021
b792336
refactor: update instantiation with better typings
notaphplover Apr 14, 2021
a3b7c9d
refactor: update Lookup.clone to use a Typeguard
notaphplover Apr 14, 2021
f94f125
refactor: update error msg with non any parameters
notaphplover Apr 14, 2021
3fef493
Merge branch 'master' of https://github.com/inversify/InversifyJS int…
notaphplover Apr 16, 2021
bcf0880
fix: update onActivation test to use a binding with a transient scope…
notaphplover Apr 16, 2021
161d0b2
Merge branch 'master' of https://github.com/inversify/InversifyJS int…
notaphplover Apr 18, 2021
f7a064e
feat: update container._propagateDeactivation to not to _triggerOnDea…
notaphplover Apr 19, 2021
9f40b2e
style: make it name shorter
notaphplover Apr 19, 2021
f75be4d
docs: added get async docs
notaphplover Apr 20, 2021
9f17834
docs: update container docs
notaphplover Apr 21, 2021
b2d8e61
docs: add activation handler and pre destroy docs
notaphplover Apr 21, 2021
292bab9
add missing types and refactor types to use BindingActivation and Bin…
notaphplover Apr 21, 2021
28c5d4e
add deactivation_handler docs
notaphplover Apr 21, 2021
06e66e3
fix async multi inject and property inject
tonyhallett Apr 22, 2021
8854c42
Container get all async methods to Promise<T[]>. singular async to as…
tonyhallett Apr 22, 2021
62390ba
container resolution type correction and improve lazy in sync test
tonyhallett Apr 22, 2021
1cc0df4
add typings at resolver and compact boolean logic at container._getBu…
notaphplover Apr 22, 2021
53a739c
add isPromiseOrContainsPromise
notaphplover Apr 22, 2021
b5421a0
update isPromise to receive unknown and a generic type
notaphplover Apr 22, 2021
b7a1845
refactor _createInstance
tonyhallett Apr 23, 2021
74e07a4
refactor _resolveRequests with array reduce
tonyhallett Apr 23, 2021
c7f97df
type to interface
tonyhallett Apr 23, 2021
ad07f4b
test coverage
tonyhallett Apr 23, 2021
6e58b9a
correct spelling in tests and correct expect in handler
tonyhallett Apr 23, 2021
455a48d
deactivate refactor and name changes
tonyhallett Apr 23, 2021
4df7e91
refactor activation and deactivation
tonyhallett Apr 23, 2021
e7c7943
update wikis and dynamic value typing
tonyhallett Apr 24, 2021
70be077
rebindAsync, missing module functionality and wiki updates
tonyhallett Apr 25, 2021
6b1d44d
Merge branch 'master' of https://github.com/inversify/InversifyJS int…
notaphplover Apr 25, 2021
004dc56
Merge branch 'master' into async-v2
tonyhallett Apr 26, 2021
f707594
review changes - type name change and missing snapshot moduleActivati…
tonyhallett Apr 26, 2021
00a1678
last code climate refactor
tonyhallett Apr 26, 2021
b118ab0
docs: update changelog
notaphplover Apr 27, 2021
6d525a2
feat: add lookup.removeIntersection
notaphplover Apr 27, 2021
e2f0099
test: add test for lookup.removeIntersection
notaphplover Apr 28, 2021
530eb86
test: improve module_activation_store tests
notaphplover Apr 28, 2021
748492e
test: add test to ensure unbind async throws an error when no binding…
notaphplover Apr 28, 2021
d2751a7
100% coverage
tonyhallett Apr 29, 2021
63a8679
correct test to match description
tonyhallett Apr 29, 2021
3ad854f
wiki grammar correction
tonyhallett Apr 29, 2021
dcf96ee
make container unload methods explicit that applies equally to async
tonyhallett Apr 29, 2021
36cfea6
type changes
tonyhallett Apr 29, 2021
f76a933
wiki changes
tonyhallett Apr 29, 2021
d06d0b0
update interfaces.Container.createChild to avoid receiving parameters
notaphplover Apr 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/container/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class Container implements interfaces.Container {
public static merge(
container1: interfaces.Container,
container2: interfaces.Container,
...container3: interfaces.Container[]
...containers: interfaces.Container[]
): interfaces.Container {
const container = new Container();
const targetContainers: interfaces.Lookup<interfaces.Binding<any>>[] = [container1, container2, ...container3]
const targetContainers: interfaces.Lookup<interfaces.Binding<any>>[] = [container1, container2, ...containers]
.map((targetContainer) => getBindingDictionary(targetContainer));
const bindingDictionary: interfaces.Lookup<interfaces.Binding<any>> = getBindingDictionary(container);

Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ namespace interfaces {
load(...modules: ContainerModule[]): void;
loadAsync(...modules: AsyncContainerModule[]): Promise<void>;
unload(...modules: ContainerModuleBase[]): void;
unloadAsync(...modules: interfaces.ContainerModuleBase[]): Promise<void>
unloadAsync(...modules: ContainerModuleBase[]): Promise<void>
applyCustomMetadataReader(metadataReader: MetadataReader): void;
applyMiddleware(...middleware: Middleware[]): void;
snapshot(): void;
restore(): void;
createChild(): Container;
createChild(containerOptions?: interfaces.ContainerOptions): Container;
tonyhallett marked this conversation as resolved.
Show resolved Hide resolved
}

export type Bind = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindingToSyntax<T>;
Expand Down