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

Strongly-typed `Provider` API #407

Closed
matanlurey opened this Issue May 24, 2017 · 4 comments

Comments

Projects
1 participant
@matanlurey
Contributor

matanlurey commented May 24, 2017

Blocking issue for #364:

  • Using provide(), just T (type), or new/const Provider() (with multiple optional parameters):
    • const Provider<Foo>()
    • const Provider<Foo>.useExisting(AbstractFoo)
    • const Provider<Foo>.useClass(FooImpl)
    • const Provider<Foo>.useFactory(createFoo)
    • const Provider<Foo>.useValue(const Foo())

@matanlurey matanlurey added this to the V4 Beta milestone May 24, 2017

@matanlurey matanlurey self-assigned this May 25, 2017

@matanlurey

This comment has been minimized.

Contributor

matanlurey commented May 31, 2017

It's risky to add this until we have one compiler, so marking as blocked.

@matanlurey

This comment has been minimized.

Contributor

matanlurey commented Jul 11, 2017

Pushed to 5x.

@matanlurey matanlurey added this to Backlog in 💉 DI 1.5 Jul 17, 2017

alorenzen added a commit that referenced this issue Jul 18, 2017

cleanup(DI): Prepare to implement DI 1.5's typed Provider.
* Start moving the DI runtime to "src/di/**.dart".
* Type all "dynamic" fields as "Object".
* Add an (unused) generic type [T] to `Provider`.

Work on #407.

Created a new `RuntimeProvider` interface that means that
the provider can be used to create a `ReflectiveInjector`
at runtime. This will be removed from everything but the
`SlowProvider` interface in a future CL/after cleanups.

PiperOrigin-RevId: 162400737

matanlurey added a commit that referenced this issue Jul 19, 2017

cleanup(DI): Prepare to implement DI 1.5's typed Provider.
* Start moving the DI runtime to "src/di/**.dart".
* Type all "dynamic" fields as "Object".
* Add an (unused) generic type [T] to `Provider`.

Work on #407.

Created a new `RuntimeProvider` interface that means that
the provider can be used to create a `ReflectiveInjector`
at runtime. This will be removed from everything but the
`SlowProvider` interface in a future CL/after cleanups.

PiperOrigin-RevId: 162400737

@matanlurey matanlurey moved this from Backlog to In Progress in 💉 DI 1.5 Jul 19, 2017

alorenzen added a commit that referenced this issue Jul 27, 2017

feat(Compiler): Add a few more tests and support for useValue|useFact…
…ory.

* Split parse code into more methods on `ProviderReader`.
* Added (very basic) dependency parsing, will sync with source_gen impl.

Work towards #407.

PiperOrigin-RevId: 163213440

matanlurey added a commit that referenced this issue Aug 1, 2017

feat(Compiler): Add a few more tests and support for useValue|useFact…
…ory.

* Split parse code into more methods on `ProviderReader`.
* Added (very basic) dependency parsing, will sync with source_gen impl.

Work towards #407.

PiperOrigin-RevId: 163213440
@matanlurey

This comment has been minimized.

Contributor

matanlurey commented Jan 24, 2018

This is complete, and staged, but not yet released (it crashes Dart2JS).

We should make sure to have a lower-bounds of the dev-release that supports it.

/cc @hterkelsen when his fix is released.

@matanlurey

This comment has been minimized.

Contributor

matanlurey commented Feb 24, 2018

Looks like this is working now!

@matanlurey matanlurey closed this Feb 24, 2018

@matanlurey matanlurey moved this from In Progress to Done in 💉 DI 1.5 Apr 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment