This repository has been archived by the owner on Mar 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Investigate options to reduce boiler plate in Typescript rugs #24
Labels
Comments
Tradeoff between readability/reducing noise vs engineering best practices indeed. |
imports could be produced by generating an aggregate module containing just exports, but would mean that a little more in terms of each use: import * as atomist from '@atomist/rug/All'
val foo: atomist.File = null But this has the obvious drawback that we'll have to rev this aggregate when any of the core types change, and as we move those types out of Rug library itself, that'll become even more difficult to manage. |
The below looks nice. It's removed any weird duplication due to the way decorators work, and provides a simple way to lookup services like the PathExpressionEngine. import {SimpleEditor} from "./ProjectEditor"
import {Project} from "../model/Core"
import {Parameter} from "./Parameters"
import {PathExpressionEngine} from "../tree/PathExpression"
import {Result,Status} from "./Result"
import {Registry} from "./Registry"
let editor: SimpleEditor = {
name: "HelloWorld",
description: "Much simpler API for editors",
parameters: [{name: "content", pattern: "^.*$", required: true, description: "Simple content param"}],
edit: (project: Project, {content} : {content: string}) => {
//codes here
let engine: PathExpressionEngine = project.context().pathExpressionEngine()
return new Result(Status.Success, "Woot")
}
} |
kipz
added a commit
to atomist-attic/licensing-editors
that referenced
this issue
Dec 16, 2016
kipz
added a commit
to atomist-attic/licensing-editors
that referenced
this issue
Dec 16, 2016
kipz
added a commit
to atomist-attic/travis-editors
that referenced
this issue
Dec 16, 2016
ddgenome
added a commit
to atomist-attic/travis-editors
that referenced
this issue
Dec 16, 2016
atomist-attic/rug#24 Update to new model and prepare for 0.6.0 release
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently there are many imports, quite a few annotations and some verbose APIs.
There are many options here, including wildcard imports, improved APIs, increased use of conventions etc.
The text was updated successfully, but these errors were encountered: