@fictjs/compiler 0.2.3 → 0.3.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/README.md +5 -0
- package/dist/index.cjs +1016 -429
- package/dist/index.d.cts +37 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +1016 -429
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -24,8 +24,13 @@ createFictPlugin({
|
|
|
24
24
|
onWarn(warning) {
|
|
25
25
|
console.warn(warning)
|
|
26
26
|
},
|
|
27
|
+
// Allow $state/$effect inside reactive-scope callbacks (e.g., renderHook(() => ...))
|
|
28
|
+
reactiveScopes: ['renderHook'],
|
|
27
29
|
})
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
- `dev` (default: `NODE_ENV !== 'production' && NODE_ENV !== 'test'`): enables compiler warnings/diagnostics. Set to `false` to silence warnings.
|
|
31
33
|
- `onWarn`: custom warning handler (only called when `dev` is enabled).
|
|
34
|
+
- `reactiveScopes`: function names whose **first callback argument** is treated as a component-like reactive scope.
|
|
35
|
+
- Only **direct calls** are recognized (e.g., `renderHook(() => ...)` or `utils.renderHook(() => ...)`).
|
|
36
|
+
- **Aliases/indirect calls** are not recognized (e.g., `const rh = renderHook; rh(() => ...)`).
|