Commit Graph

23 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
d63d52b817 feat: implement comprehensive circular dependency detection system
- Add two-level circular dependency detection (local and global)
- Implement CycleDetector for local scope cycle detection
- Implement GlobalCycleDetector for cross-scope cycle detection
- Add CircularDependencyException with detailed dependency chain info
- Integrate cycle detection into Scope class with unique scope IDs
- Extend CherryPick helper with cycle detection management API
- Add safe scope creation methods with automatic detection
- Support both synchronous and asynchronous dependency resolution
- Include comprehensive test coverage (72+ tests)
- Add bilingual documentation (English and Russian)
- Provide usage examples and architectural best practices
- Add performance recommendations and debug tools

BREAKING CHANGE: Scope constructor now generates unique IDs for global detection

fix: remove tmp files

update examples

update examples
2025-08-01 08:31:50 +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
8468eff5f7 docs: add full English tutorial for CherryPick DI
- Added doc/full_tutorial_en.md: complete translation and detailed guide for CherryPick DI usage in Dart/Flutter projects
2025-06-21 15:31:52 +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
Sergey Penkovsky
e7f20d8f63 docs: move and update quick start guides to ./doc directory
- Перемещены и обновлены quick_start_en.md и quick_start_ru.md
- Файлы удалены из cherrypick/doc, теперь находятся в корне doc/
- Описаны актуальные примеры и улучшена структура
2025-06-17 17:22:30 +03:00
Sergey Penkovsky
e057bb487b docs: add annotation usage guides (en, ru) with up-to-date examples and best practices 2025-06-17 17:19:08 +03:00
Sergey Penkovsky
f6da7568fe add melos and rebase project structure 2025-05-02 11:41:18 +03:00
Sergey Penkovsky
58245fb665 fixed docs and code 2021-12-10 22:04:51 +03:00
Sergey Penkovsky
e2cc712840 updated doc 2021-10-20 09:17:10 +03:00
Sergey Penkovsky
93f431ce93 Update quick_start_ru.md 2021-04-27 13:06:44 +03:00
Sergey Penkovsky
f3b1ee84b2 renamed package 2021-04-26 14:56:09 +03:00
Sergey Penkovsky
2568414a1b implemented doc 2021-04-26 10:47:16 +03:00
Sergey Penkovsky
1ddbb74e3f added documentation 2021-04-26 10:47:16 +03:00