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

Context builder API #100

Open
briancavalier opened this issue May 14, 2013 · 2 comments
Open

Context builder API #100

briancavalier opened this issue May 14, 2013 · 2 comments
Assignees
Milestone

Comments

@briancavalier
Copy link
Member

Imagine an API like:

function wire(contextBuilder: function) : Promise;

Where contextBuilder is a function that receives some new API that can be used to programmatically build up a wired context (or more likely a promise for one):

function myContextBuilder(someNewWireAPI) {
    // Call various methods on someNewWireAPI to create and configure components
    return <some opaque representation of the context built up by someNewWireAPI>;
}

This quite powerful. The current object literal parser could even be built from such an API:

function objectLiteralParserContextBuilder(someNewWireAPI) {
    // parse object literal as we do today and call methods on someNewWireAPI
    return <some opaque representation of the context built up by someNewWireAPI>;
}

Parsers for other formats could be built in the same way, or someone could simply choose to use the programmatic API if they prefer that style.

The object literal parser is currently too entangled in the machinery to make this work in the short term, but I really think this could be a good direction to go after 0.10.0.

Thoughts?

@scothis
Copy link
Member

scothis commented May 14, 2013

Decoupling the object-literal spec format from the wire machinery can only be a good thing. Do you have a feel for the impact on plugin authors? Or if this change would make sense before 1.0 vs 2.0?

@unscriptable
Copy link
Member

+1. seems like a worthwhile endeavor

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

No branches or pull requests

3 participants