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

[TypeScript] Retrieving the bindingDictionary copy – can't resolve getBindingDictionary imports #1264

Open
am0wa opened this issue Dec 4, 2020 · 1 comment

Comments

@am0wa
Copy link

am0wa commented Dec 4, 2020

We want to dispose all Disposable Services from Container.
It's useful to be able to retrieve the bindingDictionary copy for writing the Unit tests as well.
getBindingDictionary might help to solve such common problem.

Expected Behavior

to be able to import { getBindingDictionary } from 'inversify' or from 'inversify/utils' or 'inversify/planning' etc.

Current Behavior

getBindingDictionary imports doesn't work as it's internal stuff, so neither webpack nor jest can resolve it(.

import { getBindingDictionary } from 'inversify/dts/planning/planner';

Possible Solution

  • to export handy utils and interfaces for work with the bindingDictionary
  • to put *.d.ts typings next to the *.js files so the import directories would match

Stack trace

ERROR in ./src/bootstrap/bootstrap.tsx 12:0-70
Module not found: Error: Can't resolve 'inversify/dts/planning/planner' in 'app/src/bootstrap'

@am0wa am0wa changed the title Retrieving the bindingDictionary copy – can't resolve getBindingDictionary imports [TypeScript] Retrieving the bindingDictionary copy – can't resolve getBindingDictionary imports Dec 4, 2020
@notaphplover
Copy link
Member

The binding dictionary is an internal data structure and it should not be retrieved. What is the motivation to request this feature? I would love to know the use case 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants