We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using constructors and instance methods would allow this functionality to be:
So:
class Pub { Pub({String sdkPath}); get(...); //... PubGlobal get global => new PubGlobal(pub: this); } class PubGlobal { PubGlobal({Pub pub}); // The rest pretty much stays as is. } // Replaces [Dart]. class Vm { Vm({String sdkPath}); run(...); //... } // Replaces [Dart2js]. class Compiler { Compiler({String sdkPath}); compile(...); //... } class Analyzer { Analyzer.sdk({String sdkPath}); /// Uses pub by default, or sdk if it matches constraint and saves downloading. Analyzer({VersionConstraint constraint}); analyze(...); //... } // Calls `dartfmt`. class Formatter { Formatter.sdk({String sdkPath}); /// Uses pub by default, or sdk if it matches constraint and saves downloading. Formatter({VersionConstraint constraint}); //... }
Then for a little extra convenience, we could either expose them at the top-level:
final Pub pub = new Pub(); final Vm vm = new Vm(); final Compiler compiler = new Compiler(); final Analyzer analyzer = new Analyzer(); final Formatter formatter = new Formatter();
or as members of a reified SDK (which can also be configured, passed around, mocked, etc.):
final Sdk sdk = new Sdk(); class Sdk { final String path; Directory get dir => new Directory(path); /// Defaults the path using the current [getSdkDir] logic. Sdk({this.path}); Vm get vm => new Vm(sdkPath: path) ; Compiler get compiler => new Compiler(sdkPath: path); Analyzer get analyzer => new Analyzer.sdk(sdkPath: path); Formatter get formatter => new Formatter.sdk(sdkPath: path); Pub get pub => new Pub(sdkPath: path); }
or both:
final Pub pub = sdk.pub; final Vm vm = sdk.vm; final Compiler compiler = sdk.compiler; final Analyzer analyzer = new Analyzer(); final Formatter formatter = new Formatter();
Example usage:
pub.get(...); pub.global.run(...); vm.run(...); compiler.compile(...); analyzer.analyze(...); sdk.analyzer.analyze(...); formatter.format(...); sdk.formatter.format(...);
This would be a big breaking change, but well worth it IMO.
The text was updated successfully, but these errors were encountered:
Resolution: yes! but let's try and be conscious of reducing the number of breaking changes.
Sorry, something went wrong.
Add regression tests for bugs that are working now.
0a792af
(They were fixed by some combination of the previous commits.) Fix google#204. Fix google#206. Fix google#249. [email protected] Review URL: https://chromiumcodereview.appspot.com//1188933002.
No branches or pull requests
Using constructors and instance methods would allow this functionality to be:
So:
Then for a little extra convenience, we could either expose them at the top-level:
or as members of a reified SDK (which can also be configured, passed around, mocked, etc.):
or both:
Example usage:
This would be a big breaking change, but well worth it IMO.
The text was updated successfully, but these errors were encountered: