Skip to content

Latest commit

 

History

History
104 lines (80 loc) · 2.72 KB

File metadata and controls

104 lines (80 loc) · 2.72 KB

Fict Config Profiles (Dev / CI / Prod)

This document defines practical defaults for compiler/runtime configuration.

  • Compiler defaults prioritize DX and correctness.
  • Runtime defaults prioritize DX in development and performance in production.

Compiler Defaults

Current @fictjs/compiler defaults:

  • fineGrainedDom: true
  • lazyConditional: true
  • getterCache: true
  • optimize: true
  • optimizeLevel: 'safe'
  • inlineDerivedMemos: true
  • strictGuarantee: true
  • NODE_ENV=production force-enables strictGuarantee even when options request opt-out
  • strictReactivity: false
  • dev: false

Set dev: true to attach authored source labels to signal, memo, and effect DevTools registrations. Set lazyConditional: false to preserve authored control-flow returns instead of installing runtime branch bindings. Because that also removes the reactive return re-execution capability, such returns report FICT-R006 and fail closed under strictGuarantee; use the option with strictGuarantee: false only in a non-production fallback build. getterCache caches repeated signal/accessor reads only inside safe synchronous callbacks; set it to false to emit every read directly. optimizeLevel: 'full' opts into constant propagation and legacy algebraic identities; the default 'safe' profile leaves authored algebra alone. inlineDerivedMemos: false preserves user-named single-use derived memos; compiler-generated __* temporaries can still be inlined. User-named derived values in hooks are always preserved.

Official bundler integrations keep module metadata in their graph and consume versioned metadata published by third-party packages. The 0.31 compiler does not write source-adjacent or .fict-cache/metadata sidecars.

Recommended Profiles

Dev (local development)

{
  sourcemap: true,
  dev: true,
  strictGuarantee: true,
  strictReactivity: false,
}

CI (merge gate / release gate)

{
  sourcemap: true,
  strictGuarantee: true,
  strictReactivity: true,
}

And force strict mode globally in CI:

FICT_STRICT_GUARANTEE=1

Prod (application build)

{
  dev: false,
  sourcemap: false, // or hidden/external, per deployment policy
  strictGuarantee: true,
  strictReactivity: false,
}

Runtime Defaults

Cycle protection defaults:

  • Development: enabled (NODE_ENV !== 'production')
  • Production: disabled (NODE_ENV === 'production')

Optional runtime tuning:

import { setCycleProtectionOptions } from 'fict/advanced'

// Dev/soak test strict mode
setCycleProtectionOptions({
  enabled: true,
  devMode: true,
})

// Production performance-first (default behavior)
setCycleProtectionOptions({
  enabled: false,
})

For option details, see docs/cycle-protection.md.