@fictjs/compiler 0.4.0 → 0.5.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/README.md +3 -0
- package/dist/index.cjs +765 -86
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +765 -86
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ createFictPlugin({
|
|
|
24
24
|
onWarn(warning) {
|
|
25
25
|
console.warn(warning)
|
|
26
26
|
},
|
|
27
|
+
// Keep single-use derived values as memos (strict memo mode)
|
|
28
|
+
// inlineDerivedMemos: false,
|
|
27
29
|
// Allow $state/$effect inside reactive-scope callbacks (e.g., renderHook(() => ...))
|
|
28
30
|
reactiveScopes: ['renderHook'],
|
|
29
31
|
})
|
|
@@ -31,6 +33,7 @@ createFictPlugin({
|
|
|
31
33
|
|
|
32
34
|
- `dev` (default: `NODE_ENV !== 'production' && NODE_ENV !== 'test'`): enables compiler warnings/diagnostics. Set to `false` to silence warnings.
|
|
33
35
|
- `onWarn`: custom warning handler (only called when `dev` is enabled).
|
|
36
|
+
- `inlineDerivedMemos` (default: `true`): allow the compiler to inline single-use derived values. Set to `false` for a “strict memo” mode where user-named derived values keep explicit memo accessors (unless `"use no memo"` disables memoization).
|
|
34
37
|
- `reactiveScopes`: function names whose **first callback argument** is treated as a component-like reactive scope.
|
|
35
38
|
- Only **direct calls** are recognized (e.g., `renderHook(() => ...)` or `utils.renderHook(() => ...)`).
|
|
36
39
|
- **Aliases/indirect calls** are not recognized (e.g., `const rh = renderHook; rh(() => ...)`).
|