microsoft / microsoft/tsyringe
Feature request: Disallowing singleton override
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6k
- Forks
- 184
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
There is currently no way to disallow tsyringe from overriding existing registrations for singletons. This would be really useful to prevent erroneously overriding existing registrations.
A good way to handle this is the SimpleInjector approach: https://simpleinjector.readthedocs.io/en/latest/howto.html#override-existing-registrations
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how tsyringe currently handles registration overrides and compare the requested behavior with the linked SimpleInjector guidance. Define the API and failure behavior for disallowing singleton overrides, then add tests covering existing and non-existing registrations; the work is done when those tests demonstrate that protected registrations cannot be replaced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100