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

Generate a mixin with code generator #51

Merged
merged 7 commits into from
Jan 20, 2019
Merged

Generate a mixin with code generator #51

merged 7 commits into from
Jan 20, 2019

Conversation

katis
Copy link
Contributor

@katis katis commented Jan 20, 2019

Moved templates into their own files.

Changed the code generator to generate a mixin, this allows user defined constructors and inheritance of stores.

@codecov
Copy link

codecov bot commented Jan 20, 2019

Codecov Report

Merging #51 into master will increase coverage by 0.41%.
The diff coverage is 97.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   96.14%   96.55%   +0.41%     
==========================================
  Files          22       29       +7     
  Lines         726      784      +58     
==========================================
+ Hits          698      757      +59     
+ Misses         28       27       -1
Flag Coverage Δ
#example 100% <100%> (ø) ⬆️
#flutter_mobx 100% <ø> (ø) ⬆️
#mobx 96.32% <97.45%> (+0.43%) ⬆️
#mobx_codegen 97.76% <97.45%> (+2.69%) ⬆️
Impacted Files Coverage Δ
mobx/lib/src/api/annotations.dart 0% <ø> (ø) ⬆️
example/lib/src/generator_example.g.dart 100% <100%> (ø) ⬆️
example/lib/src/generator_example.dart 100% <100%> (ø) ⬆️
mobx_codegen/lib/src/template/comma_list.dart 100% <100%> (ø)
mobx_codegen/lib/src/template/action.dart 100% <100%> (ø)
mobx_codegen/lib/src/template/store.dart 100% <100%> (ø)
mobx_codegen/lib/src/template/computed.dart 100% <100%> (ø)
mobx_codegen/lib/src/template/util.dart 100% <100%> (ø)
mobx_codegen/lib/src/template/rows.dart 100% <100%> (ø)
mobx_codegen/lib/src/template/observable.dart 100% <100%> (ø)
... and 8 more

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 0f04ce0...db88aad. Read the comment docs.

@@ -6,10 +6,10 @@ targets:

builders:
todo_reporter:
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be renamed to mobx_generator or something like that?

Copy link
Member

Choose a reason for hiding this comment

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

definitely not a todo_reporter ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed


@override
void updateNames({String firstName, String lastName}) {
final _\$prevDerivation = _\$UserActionController.startAction();
final _\$prevDerivation = _\$UserBaseActionController.startAction();
Copy link
Member

Choose a reason for hiding this comment

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

This is a great way to add the convenience of calling the method as is!! 🏆, now that we surround with {start,end}Action()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, wrapping the method with Action would have been a pain or even impossible if we wanted to support generics, positional and named arguments.

@katis katis merged commit c5f8bbb into master Jan 20, 2019
@katis katis deleted the codegen_mixin branch January 20, 2019 09:49
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.

None yet

2 participants