Skip to content
This repository has been archived by the owner on Jul 20, 2018. It is now read-only.

Provide mechanism for transformers to validate parameters #56

Open
DartBot opened this issue Jun 5, 2015 · 1 comment
Open

Provide mechanism for transformers to validate parameters #56

DartBot opened this issue Jun 5, 2015 · 1 comment
Labels

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2152569?v=3" align="left" width="96" height="96"hspace="10"> Issue by blois
Originally opened as dart-lang/sdk#20170


Angular's transformers need a complex chunk of code to read and validate transformer parameters from the pubspec.yaml file, and generates not-too-helpful errors-
https://github.com/angular/angular.dart/blob/master/lib/transformer.dart#L64

It would be great if this were provided by BarbackSettings and could give users much better error messages (with location in the pubspec file?)

Polymer has a very similar validation as well (and all of them are currently just printing errors).

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


As we discussed in person, throwing errors rather than just printing them to stdout will cause them to be handled gracefully by pub and associated with the configuration being processed.

There's probably room here for a json_rpc_2-style API for easily validating the presence and type of values, though. See http://www.dartdocs.org/documentation/json_rpc_2/0.1.0/index.html#json_rpc_2/json_rpc_2.Parameters for example.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant