@navios/di-react 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2025-01-XX
9
+
10
+ ### Added
11
+
12
+ - **Initial Release**: React integration for `@navios/di` dependency injection container
13
+ - **ContainerProvider**: React context provider for DI container access
14
+ - **ScopeProvider**: Provider for request-scoped service isolation
15
+ - **useContainer**: Hook to access the DI container from React context
16
+ - **useRootContainer**: Hook to access the root container regardless of scope
17
+ - **useService**: Hook for fetching services with loading/error states and automatic invalidation subscription
18
+ - **useSuspenseService**: Hook for fetching services using React Suspense
19
+ - **useOptionalService**: Hook for optionally loading services that may not be registered
20
+ - **useInvalidate**: Hook for invalidating services by token
21
+ - **useInvalidateInstance**: Hook for invalidating services by instance
22
+ - **useScope**: Hook to get the current scope ID
23
+ - **useScopeOrThrow**: Hook to get the current scope ID with error if not in scope
24
+ - **useScopedContainer**: Hook to get the current ScopedContainer
25
+ - **useScopedContainerOrThrow**: Hook to get the current ScopedContainer with error if not in scope
26
+ - **useScopeMetadata**: Hook to access scope metadata
27
+ - **Automatic Invalidation Subscription**: `useService` and `useSuspenseService` automatically subscribe to service invalidation events
28
+ - **Type-safe API**: Full TypeScript support with compile-time type checking
29
+ - **React 18 & 19 Support**: Compatible with both React 18 and React 19
30
+
31
+ ### Features
32
+
33
+ - Automatic service re-fetching when services are invalidated
34
+ - Support for injection tokens with Zod schema validation
35
+ - Request-scoped service isolation via `ScopeProvider`
36
+ - Synchronous instance resolution when available (optimization)
37
+ - React Suspense integration for declarative loading states
38
+ - Optional service loading for feature flags and plugins
39
+