Emit static Effect schema declarations#1
Conversation
a3df1f4 to
3bafe2c
Compare
|
Update: the emitter now also handles direct bare schema models like For those classes it now synthesizes:
It also tightens recognition to schema aliases Validation:
|
3bafe2c to
b6e686e
Compare
|
Updated again after measuring direct bare Latest scanner comparison with this compiler:
Bare Also fixed synthesized interface/namespace export-ness so non-exported local schema classes merge correctly inside their source module. |
b6e686e to
630474a
Compare
Summary
Adds declaration-emitter support for Effect schema model facades so
.d.tsemit can materialize the same static shape we currently generate in scanner source:namespace X { interface Encoded ... }fromS.StructNestedEncoded<typeof X>interface X,namespace X.Make,X.DecodingServices, andX.EncodingServicesS.OpaqueFacade<X, X.Encoded, X.Make, X.DecodingServices, X.EncodingServices, {}>fields,mapFields,copy,to, andfrom__X_base/__Xwrapper for model classes with own members, matching native source codegen shapeThis intentionally lives in declaration emit and checker/node-builder plumbing only, so it can be carried as a patch onto Effect's TypeScript compiler fork later.
Validation
npm run build:compilerAggregate Instantiations: 13,917,040Aggregate Instantiations: 13,840,894Aggregate Instantiations: 17,871,742The d.ts-emitter path recovered roughly 98% of the static-native source-codegen instantiation benefit in the scanner comparison.
Notes / Gotchas
__X_basehelper classes are not reinterpreted. Rewriting those to namespace service aliases can make old generatedtype Make = X.Makealiases self-reference and collapse constructor input tonever.booleanvsfalse | truecan still differ.effect-app/TypeScriptfork only; do not retarget to the official Microsoft repository.