@navios/di-react 0.1.1 → 0.2.1

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,44 @@
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.1] - 2025-12-20
9
+
10
+ ### Fixed
11
+
12
+ - Fixed package.json exports to use correct CommonJS file extensions (`.cjs` and `.d.cts`)
13
+
14
+ ## [0.2.0] - 2025-01-XX
15
+
16
+ ### Added
17
+
18
+ - **Initial Release**: React integration for `@navios/di` dependency injection container
19
+ - **ContainerProvider**: React context provider for DI container access
20
+ - **ScopeProvider**: Provider for request-scoped service isolation
21
+ - **useContainer**: Hook to access the DI container from React context
22
+ - **useRootContainer**: Hook to access the root container regardless of scope
23
+ - **useService**: Hook for fetching services with loading/error states and automatic invalidation subscription
24
+ - **useSuspenseService**: Hook for fetching services using React Suspense
25
+ - **useOptionalService**: Hook for optionally loading services that may not be registered
26
+ - **useInvalidate**: Hook for invalidating services by token
27
+ - **useInvalidateInstance**: Hook for invalidating services by instance
28
+ - **useScope**: Hook to get the current scope ID
29
+ - **useScopeOrThrow**: Hook to get the current scope ID with error if not in scope
30
+ - **useScopedContainer**: Hook to get the current ScopedContainer
31
+ - **useScopedContainerOrThrow**: Hook to get the current ScopedContainer with error if not in scope
32
+ - **useScopeMetadata**: Hook to access scope metadata
33
+ - **Automatic Invalidation Subscription**: `useService` and `useSuspenseService` automatically subscribe to service invalidation events
34
+ - **Type-safe API**: Full TypeScript support with compile-time type checking
35
+ - **React 18 & 19 Support**: Compatible with both React 18 and React 19
36
+
37
+ ### Features
38
+
39
+ - Automatic service re-fetching when services are invalidated
40
+ - Support for injection tokens with Zod schema validation
41
+ - Request-scoped service isolation via `ScopeProvider`
42
+ - Synchronous instance resolution when available (optimization)
43
+ - React Suspense integration for declarative loading states
44
+ - Optional service loading for feature flags and plugins