-
Notifications
You must be signed in to change notification settings - Fork 6
perf(core): claw back ~0.85 kB gzip vs v0 #1759
Copy link
Copy link
Closed
Labels
arkenvChanges to the `arkenv` npm package.Changes to the `arkenv` npm package.enhancementNew feature or improvementNew feature or improvementready for agentFully specified, ready for immediate implementationFully specified, ready for immediate implementationrefactorA change to the codebase that's neither a bug fix nor added functionalityA change to the codebase that's neither a bug fix nor added functionality
Description
Activity
Metadata
Metadata
Assignees
Labels
arkenvChanges to the `arkenv` npm package.Changes to the `arkenv` npm package.enhancementNew feature or improvementNew feature or improvementready for agentFully specified, ready for immediate implementationFully specified, ready for immediate implementationrefactorA change to the codebase that's neither a bug fix nor added functionalityA change to the codebase that's neither a bug fix nor added functionality
Context
@arkenv/core@1.0.0-alpha.9is ~3.1 kB gzip / ~7.5 kB min vs v0arkenv@0.12.3~2.3 kB gzip / ~5.7 kB min (Bundlephobia;arktypepeer excluded). size-limit was raised 2.2 → 2.9 kB.This is the v1
@arkenv/corepackage (v1 branch), not the old v0arkenv/core~441 BArkEnvErrorstub.The delta is always-on in the default
import arkenvpath: issue objects, pretty-print, secret redaction,{ safe: true }, and CLI schema-capture. Not source maps, dual CJS/ESM, or arktype.Keep (out of scope)
string.host/number.port)process.envis not mutated (fix: Simplify coercion: unify ArkType and Standard Schema paths with pre-coercion model #1193)Realistic target after the cuts below: ~2.5 kB gzip. Hitting 2.0 would mean dropping redaction or
EnvIssue— don't.Subtasks
Symbol.for("arkenv.schemaCapture.v1"), feat: CLI schema loader — safely import a user's env.ts and expose its declared keys #1622) out of the defaultarkenv()path. CLI-only entry or subpath so production imports don't pay for it (~330 B min plus capture branches).formatIssues/getSchemaKeysfrom the main@arkenv/corebarrel (move to a subpath, e.g.@arkenv/core/issues). Set"sideEffects": falseon the package (currently unset; Bundlephobia reportshasSideEffects: true). size-limit and Bundlephobiaimport "*", so extra barrel exports inflate the published number; real apps also cannot tree-shake today.{ safe: true }(safeExecute,buildEnvIssue, (v1) Unify error normalization and formatting #1157) to an opt-in subpath (@arkenv/core/safeor namedtryArkenv) so the throw path does not include result-object machinery.dist/index.mjs, ignore arktype). Confirm ~2.5 kB gzip and that redaction / coercion / keywords still work on the default export.Notes
minify: falseon publish is a Nuxt rebundle constraint (docs(v1): Simplify Docs (tracking) #1527). Bundlephobia minifies itself; this does not explain the gzip gap.