1.1 KiB
1.1 KiB
effect
| effect |
|---|
| patch |
Fix module-level side effects that defeated bundler tree-shaking.
Bare top-level statements cannot be #__PURE__-annotated by the build, so
bundlers must retain them and everything they reference, even in bundles that
never use the code:
Option: the standaloneObject.defineProperty(SomeProto, "valueOrUndefined", ...)statement anchored the wholeOptionproto chain into every bundle. It is now folded into theSomeProtoinitializer.Headers: same pattern withObject.defineProperties(Proto, ...), folded into the initializer.Logger: module-levelprocess.stdout.isTTYproperty reads (potential getters, never droppable) moved insideconsolePretty.Utils: wheninternalCallwas unused, its dropped binding left behind a retained initializer tail (standard/forcedprobe with computed property reads). The selection is now wrapped in a single pure-annotated call.
A minimal Effect.succeed(123).pipe(Effect.runFork) bundle shrinks by ~1.3%
gzipped; bundles that don't use Option or Headers no longer pay for them.