@typewirets/react 0.2.0-rc.1 → 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.
Files changed (2) hide show
  1. package/CHANGELOG.md +6 -3
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.0-rc.1
4
-
5
- - Depends on `@typewirets/core` 0.2.0-rc.1.
3
+ ## 0.2.0
6
4
 
5
+ - Depends on `@typewirets/core` 0.2.0.
7
6
  - **`useTypeWire` returns preloaded falsy values.** It ended with `if (value) return value`, so a preloaded `0`, `""`, `false` or `null` suspended as if it weren't ready, and the fallback showed. It now tells "not ready" apart from a falsy value.
8
7
  - **New: `usePreload({ wires })`.** Suspends the calling component until every singleton in `wires` is created, in parallel, so components below it read them with `useTypeWire` without suspending: one fallback for a route or feature instead of one per wire. Skips wires that aren't singletons; a failed creation reaches the nearest error boundary. Works with any resolution context. New type: `UsePreloadOpts`.
9
8
  - **New: `useTypeWire(wire, { suspend: false })`.** Throws a `TypeWireError` with reason `NotPreloaded`, naming the wire, instead of suspending when the value isn't created yet, so a forgotten preload shows up at once. The default still suspends. New type: `UseTypeWireOpts`.
@@ -20,6 +19,10 @@
20
19
 
21
20
  - **CommonJS `require()` works.** The package is `"type": "module"`, so Node loaded the CommonJS build in `dist/cjs` as an ES module: `require()` from plain Node (TypeScript compiled to CommonJS, ts-node) threw `ReferenceError: exports is not defined`. Bundlers, Jest and ESM `import` were not affected. The build now writes `dist/cjs/package.json` with `{"type":"commonjs"}`.
22
21
 
22
+ ## 0.2.0-rc.1
23
+
24
+ Release candidate for 0.2.0, with the same changes. They are listed under 0.2.0.
25
+
23
26
  ## 0.1.0
24
27
 
25
28
  - Initial release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typewirets/react",
3
- "version": "0.2.0-rc.1",
3
+ "version": "0.2.0",
4
4
  "description": "React adapter for TypeWire dependency injection",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",
@@ -65,7 +65,7 @@
65
65
  }
66
66
  },
67
67
  "dependencies": {
68
- "@typewirets/core": "0.2.0-rc.1"
68
+ "@typewirets/core": "0.2.0"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "pnpm clean && pnpm --filter '@typewirets/react' --parallel '/^build:.*/'",