Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce SchemaLayout, OperationsLayout and ExecutableSchemaLayout #5588

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

martinbonnin
Copy link
Contributor

Instead of the all-in-one codegen layout, expose specialized interfaces to different codegen packages.

  • codegen.[java|kotlin].schema uses SchemaLayout
  • codegen.[java|kotlin].executableschema uses ExecutableSchemaLayout
  • codegen.[java|kotlin].operations uses OperationsLayout

For convenience, LayoutImpl is unchanged and implements all 3 interfaces but it's internal only and doesn't leak in public API.

ApolloCompiler.buildFoo() now have 2 kind of options:

  1. the "declarative" ones (IrOptions, CodegenOptions, etc...) are scalars that can be serialized in JSON option files.
  2. the "turing complete" ones (Layout, OperationOutputGenerator, ApolloCompilerHooks, etc...) are code that are serialized as classpaths.

Note: this temporarily breaks passing a custom packageNameGenerator but turns out we have no test for this. I'll re-introduce that in a follow up PR

Copy link

netlify bot commented Jan 31, 2024

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 6b9b572
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/65ba5d9bd5e3b00008520a2c

@martinbonnin martinbonnin marked this pull request as ready for review January 31, 2024 18:00
Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚙️

@martinbonnin martinbonnin merged commit 5568815 into main Feb 1, 2024
9 checks passed
@martinbonnin martinbonnin deleted the expose-layout branch February 1, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants