Replies: 1 comment
|
Drop or wait for Post-v1 (or build it as a standalone package) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Dedicated RFC and Hat evaluation to design first-class Compile-Time Dead-Code Elimination (DCE) for Client Feature Flags across Next.js, Nuxt, Vite, and Bun.
Spun out from the Next.js S-Tier architecture evaluation (PR #1613 /
docs/design/nextjs-codegen-runtime-evaluation.md) to give feature flags the focused design evaluation they deserve without cluttering the core virtual placement foundation.The Problem Statement
if (env.NEXT_PUBLIC_ENABLE_BETA)reads from an imported object / runtime Proxy."false").isEnabled("NEXT_PUBLIC_FLAG", process.env.NEXT_PUBLIC_FLAG)creates repetitive, stuttering syntax and forces developers to write rawprocess.envin their components.Design Candidates (The Hat)
Candidate 1: Single-Arg Generated
isEnabled("KEY")In client component:
.arkenv/index.tsgenerates an inlinable switch-case function containing literalprocess.env.NEXT_PUBLIC_*identifiers."false" === "true"falseCandidate 2: Generated
flagsObjectCandidate 3: Direct Named Boolean Const Exports
Acceptance Criteria
Converted from issue #1599 (not hashed out / RFC → Discussion).
All reactions