Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

All-or-nothing signatures #68

Closed
jackmellis opened this issue Jul 27, 2020 · 1 comment
Closed

All-or-nothing signatures #68

jackmellis opened this issue Jul 27, 2020 · 1 comment

Comments

@jackmellis
Copy link
Member

Rather than having to handle more and more optional rags (which is a real pain for the Babel plugin) I think there should be a single signature for the ts and a single one for the js.

This would also mean dropping the magic function parser. I would probably also drop the chaining signature

jpex.factory(‘foo’, [ ‘bah’ ], (bah) => {}, ?opts)
jpex.factory<Foo>((bah: Bah) => {}, ?opts)

Obviously big breaking changes

@jackmellis jackmellis added this to the major milestone Jul 27, 2020
jackmellis pushed a commit that referenced this issue Aug 23, 2020
- dependencies are no longer determined by reading the factory function. Either use `TS` inference, or explicitly pass an array of deps
- changed format of `.factory` `.service` and `.resolve`
- you can now pass an `opts` parameter when registering a factory i.e. `.factory<A>(fn, { lifecycle: 'none' })`
- you can now pass an `opts` parameter when resolving i.e. `.resolve<A>({ optional: true })`
- rather than calling `.factory<A>(fn).lifecycle.application()` you must now do `.factory<A>(fn, { lifecycle: 'application' })`
- clearCache now takes an arity of names, i.e. `clearCache('a', 'b', 'c')` whereas previous it took an array
- you can no longer mix ts and js modes i.e. you cannot do `.factory<A>([ 'b' ], fn)`
- `Lifecycle` is now a type rather than an enum
- wrapping a name in `__` will no longer make it optional, you must explicitly pass the optional flag

closes #68
jackmellis pushed a commit that referenced this issue Aug 24, 2020
- dependencies are no longer determined by reading the factory function. Either use `TS` inference, or explicitly pass an array of deps
- changed format of `.factory` `.service` and `.resolve`
- you can now pass an `opts` parameter when registering a factory i.e. `.factory<A>(fn, { lifecycle: 'none' })`
- you can now pass an `opts` parameter when resolving i.e. `.resolve<A>({ optional: true })`
- rather than calling `.factory<A>(fn).lifecycle.application()` you must now do `.factory<A>(fn, { lifecycle: 'application' })`
- clearCache now takes an arity of names, i.e. `clearCache('a', 'b', 'c')` whereas previous it took an array
- you can no longer mix ts and js modes i.e. you cannot do `.factory<A>([ 'b' ], fn)`
- `Lifecycle` is now a type rather than an enum
- wrapping a name in `__` will no longer make it optional, you must explicitly pass the optional flag

closes #68
jackmellis pushed a commit that referenced this issue Aug 27, 2020
- dependencies are no longer determined by reading the factory function. Either use `TS` inference, or explicitly pass an array of deps
- changed format of `.factory` `.service` and `.resolve`
- you can now pass an `opts` parameter when registering a factory i.e. `.factory<A>(fn, { lifecycle: 'none' })`
- you can now pass an `opts` parameter when resolving i.e. `.resolve<A>({ optional: true })`
- rather than calling `.factory<A>(fn).lifecycle.application()` you must now do `.factory<A>(fn, { lifecycle: 'application' })`
- clearCache now takes an arity of names, i.e. `clearCache('a', 'b', 'c')` whereas previous it took an array
- you can no longer mix ts and js modes i.e. you cannot do `.factory<A>([ 'b' ], fn)`
- `Lifecycle` is now a type rather than an enum
- wrapping a name in `__` will no longer make it optional, you must explicitly pass the optional flag

closes #68
jackmellis pushed a commit that referenced this issue Sep 25, 2020
- dependencies are no longer determined by reading the factory function. Either use `TS` inference, or explicitly pass an array of deps
- changed format of `.factory` `.service` and `.resolve`
- you can now pass an `opts` parameter when registering a factory i.e. `.factory<A>(fn, { lifecycle: 'none' })`
- you can now pass an `opts` parameter when resolving i.e. `.resolve<A>({ optional: true })`
- rather than calling `.factory<A>(fn).lifecycle.application()` you must now do `.factory<A>(fn, { lifecycle: 'application' })`
- clearCache now takes an arity of names, i.e. `clearCache('a', 'b', 'c')` whereas previous it took an array
- you can no longer mix ts and js modes i.e. you cannot do `.factory<A>([ 'b' ], fn)`
- `Lifecycle` is now a type rather than an enum
- wrapping a name in `__` will no longer make it optional, you must explicitly pass the optional flag

closes #68
@jackmellis
Copy link
Member Author

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant