Skip to content

Conversation

@ragingsquirrel3
Copy link

@ragingsquirrel3 ragingsquirrel3 commented Nov 15, 2022

Description of changes

This PR changes Dart modelgen so that instances of the model name are hardcoded rather than taken from toString() on the type, which is not recommended because that name will get minified in some environments (like Flutter web) https://dart.dev/tools/linter-rules#avoid_type_to_string.

Basically, models will have 'Post' hardcoded instead of (Post).toString() or similar.

Issue #, if available

aws-amplify/amplify-flutter#2330

Description of how you validated changes

Checklist

  • [x ] PR description included
  • [ x] yarn test passes
  • [ x] Tests are changed or added
  • [ n/a] Relevant documentation is changed or added (and PR referenced)
  • [ n/a] Breaking changes to existing customers are released behind a feature flag or major version update
  • [ x] 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.

@ragingsquirrel3 ragingsquirrel3 requested a review from a team as a code owner November 15, 2022 01:07
Copy link

@dnys1 dnys1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Merging #514 (2d436f0) into main (750ba15) will increase coverage by 2.68%.
The diff coverage is 86.79%.

@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
+ Coverage   85.89%   88.58%   +2.68%     
==========================================
  Files         143       88      -55     
  Lines        7070     6062    -1008     
  Branches     1855     1632     -223     
==========================================
- Hits         6073     5370     -703     
+ Misses        906      661     -245     
+ Partials       91       31      -60     
Impacted Files Coverage Δ
packages/appsync-modelgen-plugin/src/index.ts 0.00% <0.00%> (ø)
...elgen-plugin/src/interfaces/introspection/index.ts 0.00% <0.00%> (ø)
...lugin/src/interfaces/introspection/model-schema.ts 0.00% <0.00%> (ø)
packages/appsync-modelgen-plugin/src/plugin.ts 0.00% <0.00%> (ø)
packages/appsync-modelgen-plugin/src/preset.ts 0.00% <0.00%> (ø)
...ges/appsync-modelgen-plugin/src/utils/constants.ts 100.00% <ø> (ø)
...-plugin/src/visitors/appsync-javascript-visitor.ts 97.82% <88.88%> (-2.18%) ⬇️
...-plugin/src/visitors/appsync-typescript-visitor.ts 81.81% <93.33%> (+1.52%) ⬆️
...sync-modelgen-plugin/src/utils/process-has-many.ts 90.36% <96.00%> (+2.43%) ⬆️
...rc/visitors/appsync-model-introspection-visitor.ts 98.70% <98.70%> (ø)
... and 65 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AaronZyLee AaronZyLee merged commit 89f00a5 into aws-amplify:main Nov 15, 2022
@AaronZyLee AaronZyLee mentioned this pull request Nov 16, 2022
6 tasks
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.

6 participants