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

feat(amplify-codegen): change flutter import from datastore to core #277

Conversation

ragingsquirrel3
Copy link

This PR changes amplify-flutter (dart) codegen models so that they import from the core plugin instead of the datastore_plugin_interface. This is part of an effort in the next major version of amplify-flutter to allow customers to use codegen models without taking on a datastore dependency. One of the features in this change is model-based GraphQL helpers for the API category. That feature will allow users to have codegen files in an app that uses the API category without the datastore category. For that reason, codegen dependencies should come from core so they can be used with datastore or API exclusively. There is an amplify-flutter change to make those available in core aws-amplify/amplify-flutter#1023.

This codegen change is desired to be made available via a preview release so customers can use it during the preview stage of amplify-flutter 0.3.0 release (0.3.0-rc.x). For that reason, this PR is against the tagged-release/custom-type branch so it can use the same preview tag (presumably with incremented number). These changes are intended for use with same major version (and preview releases) of amplify-flutter.

Description of how you validated changes

In codegen repo (on branch for this PR): ran setup-dev and yarn setup-dev to make local changes available.

In amplify-flutter (on branch with deps moved), went to datastore example app and ran amplify-dev codegen models. With locally updated codegen models, ran the integration tests on android and ios, as well as flutter unit tests.

In amplify-flutter, in separate branch for model helpers, ran the same codegen command in API example app without datastore (to test API only use). flutter unit tests and integration tests pass there.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • [x ] Breaking changes to existing customers are released behind a feature flag or major version update
  • Changes are tested using sample applications for all relevant platforms (iOS/android/flutter/Javascript) that use the feature added/modified

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2021

Codecov Report

Merging #277 (3d5e2e2) into tagged-release/custom-type-preview (3a7ad1a) will increase coverage by 0.03%.
The diff coverage is 85.71%.

Impacted file tree graph

@@                          Coverage Diff                           @@
##           tagged-release/custom-type-preview     #277      +/-   ##
======================================================================
+ Coverage                               85.34%   85.37%   +0.03%     
======================================================================
  Files                                     145      145              
  Lines                                    6911     6921      +10     
  Branches                                 1750     1751       +1     
======================================================================
+ Hits                                     5898     5909      +11     
+ Misses                                    922      921       -1     
  Partials                                   91       91              
Impacted Files Coverage Δ
packages/appsync-modelgen-plugin/src/preset.ts 0.00% <0.00%> (ø)
...psync-modelgen-plugin/src/utils/process-has-one.ts 84.61% <33.33%> (ø)
.../graphql-docs-generator/src/generator/getFields.ts 78.57% <66.66%> (+0.79%) ⬆️
...nc-modelgen-plugin/src/utils/process-belongs-to.ts 90.32% <81.81%> (+1.43%) ⬆️
...nc-modelgen-plugin/src/visitors/appsync-visitor.ts 94.21% <83.33%> (ø)
packages/amplify-codegen/src/commands/models.js 83.33% <100.00%> (ø)
...appsync-modelgen-plugin/src/configs/dart-config.ts 100.00% <100.00%> (ø)
...odelgen-plugin/src/utils/process-connections-v2.ts 89.65% <100.00%> (+1.41%) ⬆️
...delgen-plugin/src/visitors/appsync-dart-visitor.ts 96.93% <100.00%> (+0.01%) ⬆️
...elgen-plugin/src/visitors/appsync-swift-visitor.ts 95.55% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a7ad1a...3d5e2e2. Read the comment docs.

@ragingsquirrel3 ragingsquirrel3 marked this pull request as ready for review November 8, 2021 22:33
@ragingsquirrel3 ragingsquirrel3 requested a review from a team as a code owner November 8, 2021 22:33
@ragingsquirrel3 ragingsquirrel3 requested a review from a team November 8, 2021 22:33
@ragingsquirrel3 ragingsquirrel3 changed the base branch from tagged-release/custom-type-preview to non-model-flutter November 9, 2021 18:28
Copy link
Contributor

@AaronZyLee AaronZyLee left a comment

Choose a reason for hiding this comment

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

LGTM 🍵

@AaronZyLee AaronZyLee merged commit 06ee64a into aws-amplify:non-model-flutter Nov 10, 2021
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.

4 participants