@navios/di-react 1.0.0-alpha.3 → 2.0.0-alpha.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +45 -665
  3. package/lib/{index.js → index.cjs} +249 -255
  4. package/lib/index.cjs.map +1 -0
  5. package/lib/{index.d.ts → index.d.cts} +94 -123
  6. package/lib/index.d.cts.map +1 -0
  7. package/lib/index.d.mts +93 -122
  8. package/lib/index.d.mts.map +1 -1
  9. package/lib/index.mjs +248 -255
  10. package/lib/index.mjs.map +1 -1
  11. package/package.json +32 -18
  12. package/coverage/base.css +0 -224
  13. package/coverage/block-navigation.js +0 -87
  14. package/coverage/clover.xml +0 -270
  15. package/coverage/coverage-final.json +0 -10
  16. package/coverage/favicon.png +0 -0
  17. package/coverage/hooks/index.html +0 -191
  18. package/coverage/hooks/use-container.mts.html +0 -268
  19. package/coverage/hooks/use-invalidate.mts.html +0 -208
  20. package/coverage/hooks/use-optional-service.mts.html +0 -910
  21. package/coverage/hooks/use-scope.mts.html +0 -346
  22. package/coverage/hooks/use-service.mts.html +0 -760
  23. package/coverage/hooks/use-suspense-service.mts.html +0 -784
  24. package/coverage/index.html +0 -131
  25. package/coverage/prettify.css +0 -1
  26. package/coverage/prettify.js +0 -2
  27. package/coverage/providers/container-provider.mts.html +0 -139
  28. package/coverage/providers/context.mts.html +0 -130
  29. package/coverage/providers/index.html +0 -146
  30. package/coverage/providers/scope-provider.mts.html +0 -355
  31. package/coverage/sort-arrow-sprite.png +0 -0
  32. package/coverage/sorter.js +0 -210
  33. package/lib/index.d.ts.map +0 -1
  34. package/lib/index.js.map +0 -1
  35. package/project.json +0 -61
  36. package/src/hooks/__tests__/use-container.spec.mts +0 -143
  37. package/src/hooks/__tests__/use-invalidate.spec.mts +0 -80
  38. package/src/hooks/__tests__/use-optional-service.spec.mts +0 -233
  39. package/src/hooks/__tests__/use-scope.spec.mts +0 -293
  40. package/src/hooks/__tests__/use-service.spec.mts +0 -212
  41. package/src/hooks/__tests__/use-suspense-service.spec.mts +0 -286
  42. package/src/hooks/index.mts +0 -14
  43. package/src/hooks/use-container.mts +0 -61
  44. package/src/hooks/use-invalidate.mts +0 -41
  45. package/src/hooks/use-optional-service.mts +0 -275
  46. package/src/hooks/use-scope.mts +0 -87
  47. package/src/hooks/use-service.mts +0 -225
  48. package/src/hooks/use-suspense-service.mts +0 -233
  49. package/src/index.mts +0 -8
  50. package/src/providers/__tests__/scope-provider.spec.mts +0 -366
  51. package/src/providers/container-provider.mts +0 -18
  52. package/src/providers/context.mts +0 -15
  53. package/src/providers/index.mts +0 -5
  54. package/src/providers/scope-provider.mts +0 -90
  55. package/src/types.mts +0 -21
  56. package/tsconfig.json +0 -13
  57. package/tsdown.config.mts +0 -14
  58. package/vitest.config.mts +0 -12
package/CHANGELOG.md CHANGED
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.0-alpha.0] - Unreleased
9
+
10
+ ### Fixed
11
+
12
+ - **`ScopeProvider` under `<StrictMode>`**: The scope survives the unmount and re-mount React simulates in development
13
+ - Disposal now waits one microtask and is cancelled by a re-mount; a real unmount and a `key` change still dispose the scope
14
+ - A provider shown again by `<Activity>` after its scope was disposed starts a new scope
15
+ - **Inline args in `useService` and `useOptionalService`**: Args are compared by their JSON form, like `useSuspenseService`, which now tells apart `Map`, `Set`, `RegExp` and `bigint` values
16
+ - An object literal written in the call no longer restarts the hook on every render
17
+ - Changed args still resolve again
18
+ - **Stale instance after an args change**: A hook that read its first instance synchronously kept it when the args, token or container changed
19
+ - **Extra constructor run on dependency invalidation**: `useService` and `useOptionalService` resolve one microtask after the invalidation event, so a dependent is not constructed against a dependency that is still being destroyed
20
+
21
+ ### Removed
22
+
23
+ - Development warning about args "that look the same but are different instances": such args are now treated as unchanged
24
+
25
+ ### Documentation
26
+
27
+ - README: `useContainer()` return type, examples that used `data` before checking it, Standard Schema wording, reserved `metadata.scopeId`, memoization advice
28
+
8
29
  ## [1.0.0-alpha.3] - 2026-01-08
9
30
 
10
31
  ### Added