Changelog
3.2.0
jpex.raw
function for extracting a factory functionuseResolve
methodChangelog
3.1.0
Window
and Document
can now be used to register dependenciesChangelog
3.0.1
jpex.factory('foo', [ 'foo' ], (foo) => { /* decorate here */ })
Changelog
3.0.0
jpex.$resolve
and jpex.$encase
have been renamed to jpex.resolve
and jpex.encase
. This is the tip of the iceberg in terms of changes. Jpex is no longer a constructor and can't be instantiated. jpex.extend
no longer accepts class-related properties, etc.jpex.factory('foo', fn).dependencies('bah', 'baz')
import jpex, { Hook } from 'jpex'
resolve
now only returns a single dependency and doesn't accept named parameters. For named params you must call resolveWith
jpex.factory<IThing>((log: ILog) => { ... })
and jpex.resolve<IThing>()
jpex.encase((thing: IThing) => () => { ... })
etc.jpex/babel-plugin
infer
: const name = jpex.infer<IThing>()
Changelog
2.1.0
properties
config is null, jpex will no longer throw an error$options
into a Jpex as a Service
service now worksJpex.register.service().bindToInstance()
allows you to bind dependencies to a service instanceJpex.$encase
method allos you to wrap a function with a number of dependenciesChangelog
2.0.0
config
option when extending a class. Any properties of the config option will be used as default values for that class and its descendants.defaultLifecycle
option.bindToInstance
option can now accept a nested property name, i.e. bindToInstance : 'foo.bah'
jpex/dist/jpex.js
and jpex/dist/jpex.min.js
$timeout
, $promise
, etc.) have been separated from the core module. They now must be installed separately from the jpex-defaults, jpex-node, and jpex-web packages.$resolve
method is now available as a static method on every class, so dependencies can be resolved with Class.$resolve(name)
. This allows for Jpex to be used as a container rather than forcing the class instantiation pattern.$resolve
can be called with an array of dependencies to resolve instead of just one.class
or application
lifecycle) can be cleared with Class.$clearCache()
.decorators
that allow a factory to be altered before being resolved. Can be registered like normal factories i.e. Class.register.decorator(name, fn)
prototype
option has been replaced with methods
required
'd with webpack/browserify, or a web-safe js file can be found at jpex/dist/jpex.js/
Class._factories
is now Class.$$factories
.$timeout
, $promise
, etc.) have been separated from the core module. They now must be installed separately from the jpex-defaults, jpex-node, and jpex-web packages.singleton
option has been removed from factory registration. Class.register.factory(name, fn, true/false)
should now be written as Class.register.factory(name, fn).lifecycle.application()
Typeof
and Copy
have been removed.Jpex.Register.Factory
becomes Jpex.register.factory
, for example.Interfaces
have been completely removed from the module. This was an experimental feature that in the end was more overhead than it was worth.Class.register.node_module
.["^someParentFactory"]
will no longer work. The equivalent can now be achieved with decorators.