Migrate to Smithy's DirectedCodegen
pattern
#1675
Labels
refactoring
Changes that do not affect our users, mostly focused on maintainability
tracking
Meta-issues to track overall progress
Smithy now provides a
DirectedCodegen
interface that essentially replaces the need to write aCodegenVisitor
, and standardizes the patterns that the newer Smithy code generators have established.I spent some time investigating what it would take to refactor our code generator to use the
DirectedCodegen
approach, and discovered this list of smaller refactors we can do that will make the transition a lot easier:NodeMapper.deserialize
to parse-RustSettings
instead of manual parsing:This method of parsing is required to use
DirectedCodegen
since theCodegenDirector
does the parsing.OperationNormalizer
withModelTransformer.createDedicatedInputAndOutput
FileManifest
RustSymbolProvider
; only theSymbolProvider
interface may be used in codegenAdditionally, we would need to break the Client/Server inheritance model for the
RustSettings
andCodegenContext
classes since the types for these need to be known at compile time. The best way to do this would probably be to keep them, but they go into their respective client/server modules, and then have aClientDirectedCodegen
and aServerDirectedCodegen
. Essentially, the server codegen would need to become its own Smithy plugin, and the shared code between client and server would need to go into a core module.Once all of these refactors are done, it looks like it should be possible to migrate, but it will still be a considerable amount of work.
The text was updated successfully, but these errors were encountered: