-
Notifications
You must be signed in to change notification settings - Fork 412
Creating a stand-alone example #80
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
Conversation
Should make it easier to get started
CC @sethladd |
Provides `source_gen` `Generator`s which generate code to | ||
make it simple to serialize to and from JSON. | ||
Provides [source_gen] `Generator`s to create code for JSON serialization and | ||
deserialization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clearly state something like "To use this package, you need to install source_gen, by going here." ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no install, per se. You just put the right things in your pubspec.
I will make sure to mention that.
@@ -15,5 +15,12 @@ The annotation package which has no dependencies. | |||
|
|||
Import it into your pubspec `dependencies:` section. | |||
|
|||
## [example] | |||
|
|||
A simple example showing how to setup and use [json_serializable] and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, where is the example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/dart-lang/json_serializable/tree/example (although the link is broken because this isn't on master yet)
* `tool/`: Contains the code run during development to create and update | ||
generated code. | ||
|
||
* `build_actions.dart`: A convention when using `package:build` to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually should change this convention - having separate scripts means they have separate asset graphs which isn't what you want.
Instead you could add a flag to change whether it calls build/watch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I have to add args parsing, etc to the example.
I'd rather have dart-lang/build#718
example/test/example_test.dart
Outdated
@@ -0,0 +1,27 @@ | |||
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like having an example which isn't putting forward best practices - but we can improve it once we have dart-lang/build#718.
Let's make best practices easier first! 😄 |
No description provided.