12 Commits

Author SHA1 Message Date
Sergey Penkovsky
484061148d docs(binding,docs): clarify .singleton() with .toInstance() behavior in docs and API
- Add an explicit note and warning about the effect (or lack thereof) of calling `.singleton()` after `.toInstance()`:
  - in singleton() API doc-comment in binding.dart,
  - in README.md (after all binding usage patterns),
  - in full_tutorial_en.md and full_tutorial_ru.md.
- Explain that `.singleton()` has no effect on objects registered with `.toInstance()` — they are always single instance.
- Recommend `.singleton()` only for providers (toProvide/toProvideAsync), not direct instances.
- Improves clarity and prevents misuse/confusion for end users and future maintainers.
2025-09-08 10:46:20 +03:00
Sergey Penkovsky
b5b672765e docs(binding,docs): explain .singleton() + parametric provider behavior
- Add an explicit warning and usage examples for .singleton() combined with toProvideWithParams/toProvideAsyncWithParams:
  - in API doc-comment for singleton() in binding.dart,
  - in README.md and both full tutorials (EN/RU).
- Show correct and incorrect usage/pitfalls for parameterized providers and singleton.
- Help users avoid unintended singleton caching when using providers with parameters.
- Motivation: Prevent common confusion, make advanced DI scenarios safer and more obvious.
2025-09-08 10:18:19 +03:00
Sergey Penkovsky
722a4d7980 docs(di): clarify 'toInstance' binding limitations in builder
- Add explicit note for users about the impossibility to use scope.resolve<T>() for just-to-be-registered types inside Module.builder when registering chained dependencies via toInstance.
- Show correct and incorrect usage patterns, functional and anti-pattern Dart examples in RU and EN full tutorials.
- Add the warning to the main README after core concept bindings block, improving discoverability for users starting with the library.
- Motivation: Prevent common misuse and hard-to-debug runtime errors for users who construct chains using toInstance/resolve inside the builder.
2025-09-08 09:23:00 +03:00
Sergey Penkovsky
a4b0ddfa54 docs(faq): add best practice FAQ about using await with scope disposal
- Added FAQ section in documentation (README and tutorials, EN + RU) recommending always using await when calling CherryPick.closeRootScope, scope.closeScope, or scope.dispose, even if no services implement Disposable.
- Clarifies future-proof resource management for all users.
2025-08-08 16:08:33 +03:00
Sergey Penkovsky
547a15fa4e docs(faq): add best practice FAQ about using await with scope disposal
- Added FAQ section in documentation (README and tutorials, EN + RU) recommending always using await when calling CherryPick.closeRootScope, scope.closeScope, or scope.dispose, even if no services implement Disposable.
- Clarifies future-proof resource management for all users.
2025-08-08 16:08:33 +03:00
Sergey Penkovsky
a9c95f6a89 docs+feat: add Disposable interface source and usage example
feat(core,doc): unified async dispose mechanism for resource cleanup

BREAKING CHANGE:

- Added full support for asynchronous resource cleanup via a unified FutureOr<void> dispose() method in the Disposable interface.
- The Scope now provides only Future<void> dispose() for disposing all tracked resources and child scopes (sync-only dispose() was removed).
- All calls to cleanup in code and tests (scope itself, subscopes, and custom modules) now require await ...dispose().
- Documentation and all examples updated: resource management is always async and must be awaited; Disposable implementers may use both sync and async cleanup.
- Old-style, synchronous cleanup methods have been completely removed (API is now consistently async for all DI lifecycle management).
- Example and tutorial code now demonstrate async resource disposal patterns.
2025-08-08 16:08:29 +03:00
Sergey Penkovsky
aa97632add feat(logger): add extensible logging API, usage examples, and bilingual documentation
- Introduce CherryPickLogger interface, PrintLogger and SilentLogger implementations
- Add setGlobalLogger() to CherryPick API for custom DI logging
- Log key events (scope, module, error) via logger throughout DI lifecycle
- Comprehensive comments and code documentation in both English and Russian
- Document usage of logging system in quick_start and full_tutorial documentation (EN/RU)
- Provide usage examples in docs and code comments
- No logging inside GlobalCycleDetectionMixin (design choice: exceptions handled at Scope, not detector/mixin level) and detailed architectural reasoning
- Update helper.dart, logger.dart: comments, examples, API doc improvements
BREAKING CHANGE: Projects can now inject any logger via CherryPick.setGlobalLogger; default log behavior clarified and docstrings/usage examples enhanced
2025-08-08 08:24:13 +03:00
Sergey Penkovsky
05cfca5977 docs(perf): clarify Map-based resolver optimization applies since v3.0.0 in all docs 2025-08-06 08:29:00 +03:00
Sergey Penkovsky
52a55219ab docs: update EN/RU quick start and tutorial with Fast Map-based lookup section; clarify performance benefit in README 2025-08-05 19:41:24 +03:00
Sergey Penkovsky
2c1f9d5969 doc: update manual 2025-07-29 08:10:08 +03:00
Sergey Penkovsky
c722ad0c07 docs: update full Russian tutorial
- Updated doc/full_tutorial_ru.md with improvements and clarifications
2025-06-21 15:45:34 +03:00
Sergey Penkovsky
24bb47f741 docs: add detailed Russian full tutorial
- Added doc/full_tutorial_ru.md with comprehensive usage and explanation of CherryPick DI
2025-06-21 15:20:30 +03:00